hub

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FList

type FList struct {
	Name    string    `json:"name"`
	Target  string    `json:"target"`
	Type    FListType `json:"type"`
	Updated uint64    `json:"updated"`
	Hash    string    `json:"md5"`
}

FList is information of flist as returned by repo list operation

type FListFilter

type FListFilter interface {
	// contains filtered or unexported methods
}

func MatchName

func MatchName(name string) FListFilter

func MatchType

func MatchType(typ FListType) FListFilter

type FListType

type FListType string
const (
	TypeRegular FListType = "regular"
	TypeSymlink FListType = "symlink"
	TypeTag     FListType = "tag"
	TypeTagLink FListType = "taglink"
)

type FileInfo

type FileInfo struct {
	Path string `json:"path"`
	Size uint64 `json:"size"`
}

FileInfo is the file of an flist

type HubClient

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

HubClient API for f-list

func NewHubClient

func NewHubClient(timeout time.Duration) *HubClient

NewHubClient create new hub client with the passed option for the http client

func (*HubClient) Download

func (h *HubClient) Download(cache, repo, name string) (string, error)

Download downloads an flist to cache and return the full path to the extraced meta data directory. the returned path is in format {cache}/{hash}/

func (*HubClient) Find

func (h *HubClient) Find(repo string, filter ...FListFilter) ([]FList, error)

func (*HubClient) HubBaseURL added in v0.1.1

func (h *HubClient) HubBaseURL() string

StorageURL return hub storage url

func (*HubClient) Info

func (h *HubClient) Info(repo, name string) (info FList, err error)

Info gets flist info from hub

func (*HubClient) List

func (h *HubClient) List(repo string) ([]FList, error)

List list repo flists

func (*HubClient) ListTag

func (h *HubClient) ListTag(repo, tag string) ([]Symlink, error)

func (*HubClient) MountURL

func (h *HubClient) MountURL(flist string) string

MountURL returns the full url of given flist.

func (*HubClient) StorageURL

func (h *HubClient) StorageURL() string

StorageURL return hub storage url

type Regular

type Regular struct {
	FList
}

func NewRegular

func NewRegular(flist FList) Regular

func (*Regular) Files

func (b *Regular) Files(repo string) ([]FileInfo, error)

Files gets the list of the files of an flist

type Symlink struct {
	FList
}
func NewSymlink(flist FList) Symlink

func (*Symlink) Destination

func (t *Symlink) Destination(source string) (repo string, name string, err error)

Destination gets destination flist for a symlink flist source repo is the repo where this symlink lives, since the symlink can either be an absolute or relative target.

type TagLink struct {
	FList
}

TagLink is an flist of type taglink

func NewTagLink(flist FList) TagLink

func (*TagLink) Destination

func (t *TagLink) Destination() (repo string, tag string, err error)

Jump to

Keyboard shortcuts

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