repo

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemaVersion = "0.1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheMetadata

type CacheMetadata struct {
	UpdatedAt time.Time         // Last updated time
	ETags     map[string]string // Last ETag for each URL
}

type Config

type Config struct {
	Repositories []Repository `json:"repositories"`
}

func (*Config) EnabledRepositories

func (c *Config) EnabledRepositories() []Repository

type Duration

type Duration struct {
	time.Duration
}

Duration is a wrapper around time.Duration that implements UnmarshalJSON

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

type Index

type Index struct {
	Path      string // Path to the index file
	UpdatedAt time.Time
	Packages  map[string]PackageEntry
}

type Location

type Location struct {
	URL string `json:"url"`
}

type Manager

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

Manager manages the repositories

func NewManager

func NewManager(cacheRoot string, opts ...ManagerOption) *Manager

func (*Manager) Clear

func (m *Manager) Clear() error

func (*Manager) Config

func (m *Manager) Config(ctx context.Context) (Config, error)

func (*Manager) DownloadRepositories

func (m *Manager) DownloadRepositories(ctx context.Context, names []string, opts Options) error

func (*Manager) Init

func (m *Manager) Init(ctx context.Context) error

func (*Manager) List

func (m *Manager) List(ctx context.Context) error

List returns a list of all repositories in the configuration

type ManagerOption

type ManagerOption func(indexer *Manager)

func WithWriter

func WithWriter(w io.Writer) ManagerOption

type Manifest

type Manifest struct {
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Versions    []Version `json:"versions"`
}

type Options

type Options struct {
	Insecure bool
}

type PackageEntry

type PackageEntry struct {
	ID       string `json:"id"`
	Location string `json:"location"`
	Format   string `json:"format"`
}

type RawIndex

type RawIndex struct {
	UpdatedAt time.Time      `json:"updated_at"`
	Packages  []PackageEntry `json:"packages"`
}

type Repository

type Repository struct {
	Name     string
	URL      string
	Enabled  bool
	Username string
	Password string
	Token    string // For Bearer
	// contains filtered or unexported fields
}

func (*Repository) Index

func (r *Repository) Index(ctx context.Context) (Index, error)

func (*Repository) Manifest

func (r *Repository) Manifest(ctx context.Context, opts Options) (Manifest, error)

func (*Repository) Update

func (r *Repository) Update(ctx context.Context, opts Options) error

type Version

type Version struct {
	SpecVersion    string     `json:"spec_version"`
	Locations      []Location `json:"locations"`
	UpdateInterval Duration   `json:"update_interval"`
}

Jump to

Keyboard shortcuts

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