getter

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGetterTypeUnknown = errors.New("no getter type found matching reference")
)

Functions

func NewDirectory

func NewDirectory() *directory

Types

type Client

type Client struct {
	Getters map[string]Getter
	Options ClientOptions
}

func NewClient

func NewClient(opts ClientOptions) *Client

func (*Client) Config

func (c *Client) Config(source string) content2.Config

func (*Client) ContentFrom added in v0.1.8

func (c *Client) ContentFrom(ctx context.Context, source string) (io.ReadCloser, error)

func (*Client) LayerFrom

func (c *Client) LayerFrom(ctx context.Context, source string) (v1.Layer, error)

func (*Client) Name

func (c *Client) Name(source string) string

type ClientOptions

type ClientOptions struct {
	NameOverride string
}

ClientOptions provides options for the client

type File

type File struct{}

func NewFile

func NewFile() *File

func (File) Config

func (f File) Config(u *url.URL) artifacts.Config

func (File) Detect

func (f File) Detect(u *url.URL) bool

func (File) Name

func (f File) Name(u *url.URL) string

func (File) Open

func (f File) Open(ctx context.Context, u *url.URL) (io.ReadCloser, error)

type Getter

type Getter interface {
	Open(context.Context, *url.URL) (io.ReadCloser, error)

	Detect(*url.URL) bool

	Name(*url.URL) string

	Config(*url.URL) content2.Config
}

type Http

type Http struct{}

func NewHttp

func NewHttp() *Http

func (*Http) Config

func (h *Http) Config(u *url.URL) artifacts.Config

func (Http) Detect

func (h Http) Detect(u *url.URL) bool

func (Http) Name

func (h Http) Name(u *url.URL) string

func (Http) Open

func (h Http) Open(ctx context.Context, u *url.URL) (io.ReadCloser, error)

Jump to

Keyboard shortcuts

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