remote

package
v0.6.8-rc.6 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind string
const (
	KindGit Kind = "git"
	KindOCI Kind = "oci"
)

type Mirror

type Mirror struct {
	Kind     Kind
	URL      string
	Auth     any
	Prefixes []string
}

tbd

type Mirrors

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

Holds the mirror mappings todo, make the value more interesting we probably want to know if pub/priv & auth settings and what to mirror where, this only says what repo kind it is prehaps we should make the primary key the url prefix, and then look up details about [reg-type,reg-auth,reg-url,mods-mirrored]

var (
	MirrorsSingleton *Mirrors
)

func NewMirrors

func NewMirrors() (*Mirrors, error)

func (*Mirrors) Close

func (m *Mirrors) Close() error

func (*Mirrors) Is

func (m *Mirrors) Is(ctx context.Context, k Kind, mod string) (bool, error)

func (*Mirrors) Set

func (m *Mirrors) Set(k Kind, s string)

type Remote

type Remote struct {
	Host  string
	Owner string
	Name  string
	// contains filtered or unexported fields
}

func NewRemote

func NewRemote(mod string, mir *Mirrors) *Remote

func Parse

func Parse(mod string) (*Remote, error)

Parse parses a module name and returns the appropriate remote for it.

func (*Remote) Kind

func (r *Remote) Kind() (Kind, error)

func (*Remote) Publish

func (r *Remote) Publish(ctx context.Context, dir string, tag string) error

func (*Remote) Pull

func (r *Remote) Pull(ctx context.Context, dir, ver string) error

Jump to

Keyboard shortcuts

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