Documentation
¶
Index ¶
- Variables
- func As[T Artifact](as []Artifact) ([]T, error)
- func Context(ctx context.Context, r Storage) context.Context
- func ErrCode(err error) int
- func Error(w http.ResponseWriter, err error)
- func IsErrorCode(err error, code string) bool
- func IsNotFound(err error) bool
- func MustAs[T Artifact](as []Artifact) []T
- func Options(ctx context.Context) options
- func WithOptions(ctx context.Context, opts ...Option) context.Context
- type Artifact
- type ArtifactInfo
- type Codec
- type File
- type MiddlewareFunc
- type Option
- type Repository
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidArtifactType = errors.New("invalid image's artifact type")
Functions ¶
func Error ¶
func Error(w http.ResponseWriter, err error)
func IsErrorCode ¶
func IsNotFound ¶
Types ¶
type Artifact ¶
type Artifact interface { io.ReadCloser // Name is the name of the artifact, e.g. "jq". Name() string // Path is the path of the artifact in the repository. Path() string // Arch is the architecture of the artifact. Arch() string // Version is the version of the artifact. Version() string // Size is the binary size of the artifact. Size() int64 Digest() digest.Digest }
func AsArtifact ¶
type ArtifactInfo ¶
type MiddlewareFunc ¶
type MiddlewareFunc = func(repoVar string) mux.MiddlewareFunc
func Middleware ¶
func Middleware(ar Repository) MiddlewareFunc
type Option ¶
type Option func(o *options)
func WithArtifactTags ¶
func WithArtifactTags() Option
func WithRegistryOptions ¶
type Repository ¶
type Storage ¶
type Storage interface { Init(ctx context.Context) error Stat(ctx context.Context, file string) (ArtifactInfo, error) Open(ctx context.Context, name string) (io.ReadCloser, error) Write(ctx context.Context, a Artifact) error Delete(ctx context.Context, name string) error Artifacts(ctx context.Context) ([]Artifact, error) ServeFile(w http.ResponseWriter, r *http.Request, name string) error Size(ctx context.Context) (int64, error) Key() string Close() error }
func FromContext ¶
func NewStorage ¶
Click to show internal directories.
Click to hide internal directories.