1
0
mirror of https://github.com/regclient/regclient.git synced 2025-04-18 22:44:00 +03:00
regclient/types/descriptor.go
Brandon Mitchell eea06e2a5c
Refactoring the type package
I feel like I need to explain, this is all to move the descriptor package.
The platform package could not use the predefined errors in types because of a circular dependency from descriptor.
The most appropriate way to reorg this is to move descriptor out of the type package since it was more complex than a self contained type.
When doing that, type aliases were needed to avoid breaking changes to existing users.
Those aliases themselves caused circular dependency loops because of the media types and errors, so those were also pulled out to separate packages.
All of the old values were aliased and deprecated, and to fix the linter, those deprecations were fixed by updating the imports... everywhere.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-03-04 15:43:18 -05:00

28 lines
900 B
Go

package types
import "github.com/regclient/regclient/types/descriptor"
type (
// Descriptor is used in manifests to refer to content by media type, size, and digest.
//
// Deprecated: replace with [descriptor.Descriptor].
Descriptor = descriptor.Descriptor
// MatchOpt defines conditions for a match descriptor.
//
// Deprecated: replace with [descriptor.MatchOpt].
MatchOpt = descriptor.MatchOpt
)
var (
// EmptyData is the content of the empty JSON descriptor. See [mediatype.OCI1Empty].
//
// Deprecated: replace with [descriptor.EmptyData].
EmptyData = descriptor.EmptyData
// EmptyDigest is the digest of the empty JSON descriptor. See [mediatype.OCI1Empty].
//
// Deprecated: replace with [descriptor.EmptyDigest].
EmptyDigest = descriptor.EmptyDigest
DescriptorListFilter = descriptor.DescriptorListFilter
DescriptorListSearch = descriptor.DescriptorListSearch
)