packages

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyConfigured = errors.New("repository already configured")
View Source
var ErrUnknownProvider = errors.New("unknown provider")

Functions

func Init

func Init(ctx context.Context, r *mux.Router, domain, repo string) error

func Names

func Names() []string

func NotFound

func NotFound(w http.ResponseWriter, _ *http.Request)

func Providers

func Providers() []string

func Register

func Register(name string, factory ProviderFactory)

func Scheme

func Scheme(r *http.Request) string

Types

type ArtifactFactory

type ArtifactFactory func(r *http.Request, reader io.Reader, size int64, key string) (storage.Artifact, error)

type Client

type Client interface {
	Signer
	Setuper
	Puller
	Pusher
	Deleter
}

type Deleter

type Deleter interface {
	Delete(ctx context.Context, path string) error
}

type HandlerFunc

type HandlerFunc func(repo string) http.HandlerFunc

func Delete

func Delete(fn func(t *http.Request) string) HandlerFunc

func Pull

func Pull(fn func(r *http.Request) string) HandlerFunc

func Push

type Provider

type Provider interface {
	Routes() []*Route
	Repository() storage.Repository
}

func New

func New(ctx context.Context, name string) (Provider, error)

type ProviderFactory

type ProviderFactory func(ctx context.Context) (Provider, error)

type Puller

type Puller interface {
	Pull(ctx context.Context, path string) (io.ReadCloser, int64, error)
}

type Pusher

type Pusher interface {
	Push(ctx context.Context, r io.Reader) error
}

type Route

type Route struct {
	Method  string
	Path    string
	Handler HandlerFunc
}

type Setuper

type Setuper interface {
	SetupScript(ctx context.Context) (string, error)
	SetupLocal(ctx context.Context, force bool) error
}

type Signer

type Signer interface {
	Key(ctx context.Context) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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