lib

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const APPLICATION_NAME = "docker-ls"

Variables

View Source
var DEFAULT_REGISTRY_URL url.URL

Functions

func ApplicationName

func ApplicationName() string

func IsMetaFileEqual

func IsMetaFileEqual(a, b *FileMeta) bool

func IsMetaValid

func IsMetaValid(cachePath string, chunkSize, totalSize int64) bool

func SaveFileMeta

func SaveFileMeta(cachePath string, meta *FileMeta) error

func Version

func Version() string

Types

type AutorizationError

type AutorizationError string

func (AutorizationError) Error

func (e AutorizationError) Error() string

type Config

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() Config

func (*Config) AllowInsecure

func (c *Config) AllowInsecure() bool

func (*Config) BindToFlags

func (c *Config) BindToFlags(flags *flag.FlagSet)

func (*Config) Credentials

func (c *Config) Credentials() auth.RegistryCredentials

func (*Config) FastChannel

func (c *Config) FastChannel() bool

func (*Config) FastChannelTokenProvider

func (c *Config) FastChannelTokenProvider() auth.FastChannelTokenProvider

func (*Config) HttpClient

func (c *Config) HttpClient() *http.Client

func (*Config) LoadCredentialsFromDockerConfig

func (c *Config) LoadCredentialsFromDockerConfig()

func (*Config) MaxConcurrentRequests

func (c *Config) MaxConcurrentRequests() uint

func (*Config) PageSize

func (c *Config) PageSize() uint

func (*Config) RegistryUrl

func (c *Config) RegistryUrl() *url.URL

func (*Config) SetAllowInsecure

func (c *Config) SetAllowInsecure(allowInsecure bool)

func (*Config) SetCredentials

func (c *Config) SetCredentials(credentials RegistryCredentials)

func (*Config) SetFastChannel

func (c *Config) SetFastChannel(fastChannel bool)

func (*Config) SetFastChannelTokenProvider

func (c *Config) SetFastChannelTokenProvider(tokenProvider auth.FastChannelTokenProvider)

func (*Config) SetHttpClient

func (c *Config) SetHttpClient(client *http.Client)

func (*Config) SetMaxConcurrentRequests

func (c *Config) SetMaxConcurrentRequests(maxRequests uint)

func (*Config) SetPagesize

func (c *Config) SetPagesize(pageSize uint)

func (*Config) SetUrl

func (c *Config) SetUrl(url url.URL)

func (*Config) SetUseBasicAuth

func (c *Config) SetUseBasicAuth(basicAuth bool)

func (*Config) SetUserAgent

func (c *Config) SetUserAgent(userAgent string)

func (*Config) UseBasicAuth

func (c *Config) UseBasicAuth() bool

func (*Config) UserAgent

func (c *Config) UserAgent() string

func (*Config) Validate

func (c *Config) Validate() error

type FileMeta

type FileMeta struct {
	Size      int64 `json:"size"`
	ChunkSize int64 `json:"chunk_size"`
	ModTime   int64 `json:"mod_time"`
}

func ReadFileMeta

func ReadFileMeta(cachePath string) (*FileMeta, error)

type InvalidRequestError

type InvalidRequestError string

func (InvalidRequestError) Error

func (e InvalidRequestError) Error() string

type InvalidStatusCodeError

type InvalidStatusCodeError string

func (InvalidStatusCodeError) Error

func (e InvalidStatusCodeError) Error() string

type LayerDetails

type LayerDetails interface {
	ContentDigest() string
}

type MalformedResponseError

type MalformedResponseError string

func (MalformedResponseError) Error

func (e MalformedResponseError) Error() string

type NotFoundError

type NotFoundError string

func (NotFoundError) Error

func (e NotFoundError) Error() string

type NotImplementedByRemoteError

type NotImplementedByRemoteError string

func (NotImplementedByRemoteError) Error

type Refspec

type Refspec interface {
	flag.Value

	Repository() string
	Reference() string
}

func EmptyRefspec

func EmptyRefspec() Refspec

func NewRefspec

func NewRefspec(repository, reference string) Refspec

type RegistryApi

type RegistryApi interface {
	ListRepositories() RepositoryListResponse
	ListTags(repositoryName string) TagListResponse
	GetTagDetails(ctx context.Context, ref Refspec, manifestVersion uint) (TagDetails, error)
	DeleteTag(ref Refspec) error
	GetStatistics() connector.Statistics
	GetBlobs(ctx context.Context, ref Refspec, manifestVersion uint, digest string) (io.ReadCloser, error)
	BlobInfo(ctx context.Context, ref Refspec, manifestVersion uint, digest string, extraHeaders map[string]string) (int64, time.Time, http.Header, error)
	RangeBlobs(ctx context.Context, ref Refspec, manifestVersion uint, digest string, start, end int64, extraHeaders map[string]string) (*http.Response, error)
	Manifests(ctx context.Context, head bool, ref Refspec, manifestVersion uint, extraHeaders map[string]string) (*http.Response, error)
}

func NewRegistryApi

func NewRegistryApi(cfg Config) (api RegistryApi, err error)

type RegistryCredentials

type RegistryCredentials struct {
	// contains filtered or unexported fields
}

func NewRegistryCredentials

func NewRegistryCredentials(user, password string) RegistryCredentials

func (*RegistryCredentials) BindToFlags

func (c *RegistryCredentials) BindToFlags(flags *flag.FlagSet)

func (*RegistryCredentials) IdentityToken

func (r *RegistryCredentials) IdentityToken() string

func (*RegistryCredentials) IsBlank

func (r *RegistryCredentials) IsBlank() bool

func (*RegistryCredentials) LoadCredentialsFromDockerConfig

func (r *RegistryCredentials) LoadCredentialsFromDockerConfig(url url.URL)

func (*RegistryCredentials) Password

func (r *RegistryCredentials) Password() string

func (*RegistryCredentials) SetPassword

func (r *RegistryCredentials) SetPassword(password string)

func (*RegistryCredentials) SetUser

func (r *RegistryCredentials) SetUser(user string)

func (*RegistryCredentials) User

func (r *RegistryCredentials) User() string

type Repository

type Repository interface {
	Name() string
}

type RepositoryListResponse

type RepositoryListResponse interface {
	Repositories() <-chan Repository
	LastError() error
}

type Tag

type Tag interface {
	Name() string
	RepositoryName() string
}

type TagDetails

type TagDetails interface {
	RawManifest() interface{}
	ContentDigest() string
	RepositoryName() string
	TagName() string
	Layers() []LayerDetails
}

type TagListResponse

type TagListResponse interface {
	Tags() <-chan Tag
	LastError() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL