repo

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersionV1 = "v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

Entry

type File

type File struct {
	APIVersion   string    `json:"apiVersion"`
	Generated    time.Time `json:"generated"`
	Repositories []*Entry  `json:"repositories"`
}

File represents the repositories.yaml file

func LoadFile

func LoadFile(path string) (*File, error)

LoadFile takes a file at the given path and returns a File object

func NewFile

func NewFile() *File

NewFile generates an empty repositories file.

Generated and APIVersion are automatically set.

func (*File) Add

func (r *File) Add(re ...*Entry)

Add adds one or more repo entries to a repo file.

func (*File) Get

func (r *File) Get(name string) *Entry

Get returns an entry with the given name if it exists, otherwise returns nil

func (*File) Has

func (r *File) Has(name string) bool

Has returns true if the given name is already a repository name.

func (*File) Remove

func (r *File) Remove(name string) bool

Remove removes the entry from the list of repositories.

func (*File) Update

func (r *File) Update(re ...*Entry)

Update attempts to replace one or more repo entries in a repo file. If an entry with the same name doesn't exist in the repo file it will add it.

func (*File) WriteFile

func (r *File) WriteFile(path string, perm os.FileMode) error

WriteFile writes a repositories file to the given path.

type SDKRepository

type SDKRepository struct {
	Config     *Entry
	ChartPaths []string
	Client     getter.Getter
	CachePath  string
}

SDKRepository represents a sdk repository For example sdkman.io

func NewSDKRepo

func NewSDKRepo(cfg *Entry, getters getter.Providers) (*SDKRepository, error)

Jump to

Keyboard shortcuts

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