Documentation ¶
Index ¶
- Constants
- func CacheDependency(a app.App, d pkg.Descriptor, customName string) error
- func DefaultYAMLData(r Registry) ([]byte, error)
- func Package(a app.App, name string) (*pkg.Package, error)
- type Fs
- func (fs *Fs) FetchRegistrySpec() (*Spec, error)
- func (fs *Fs) IsOverride() bool
- func (fs *Fs) MakeRegistryRefSpec() *app.RegistryRefSpec
- func (fs *Fs) Name() string
- func (fs *Fs) Protocol() string
- func (fs *Fs) RegistrySpecDir() string
- func (fs *Fs) RegistrySpecFilePath() string
- func (fs *Fs) ResolveLibrary(partName, partAlias, libRefSpec string, onFile ResolveFile, ...) (*parts.Spec, *app.LibraryRefSpec, error)
- func (fs *Fs) ResolveLibrarySpec(partName, libRefSpec string) (*parts.Spec, error)
- func (fs *Fs) URI() string
- type GitHub
- func (gh *GitHub) FetchRegistrySpec() (*Spec, error)
- func (gh *GitHub) IsOverride() bool
- func (gh *GitHub) MakeRegistryRefSpec() *app.RegistryRefSpec
- func (gh *GitHub) Name() string
- func (gh *GitHub) Protocol() string
- func (gh *GitHub) RegistrySpecDir() string
- func (gh *GitHub) RegistrySpecFilePath() string
- func (gh *GitHub) ResolveLibrary(partName, partAlias, libRefSpec string, onFile ResolveFile, ...) (*parts.Spec, *app.LibraryRefSpec, error)
- func (gh *GitHub) ResolveLibrarySpec(partName, libRefSpec string) (*parts.Spec, error)
- func (gh *GitHub) URI() string
- type GitHubOpt
- type LibraryRef
- type LibraryRefSpecs
- type Registry
- type ResolveDirectory
- type ResolveFile
- type Spec
- type Specs
Constants ¶
const ( // ProtocolFilesystem is the protocol for file system based registries. ProtocolFilesystem = "fs" // ProtocolGitHub is a the protocol for GitHub based registries. ProtocolGitHub = "github" )
const ( // DefaultAPIVersion is the default version of the registry API. DefaultAPIVersion = "0.1.0" // DefaultKind is the default kind of the registry API. DefaultKind = "ksonnet.io/registry" )
Variables ¶
This section is empty.
Functions ¶
func CacheDependency ¶
CacheDependency vendors registry dependencies. TODO: create unit tests for this once mocks for this package are worked out.
func DefaultYAMLData ¶
DefaultYAMLData generates the contents for a registry's spec.
Types ¶
type Fs ¶
type Fs struct {
// contains filtered or unexported fields
}
Fs is a registry based on a local filesystem.
func NewFs ¶
NewFs creates an instance of Fs. Assign a name to the RegistryRefSpec if you want the Fs to know it's name.
func (*Fs) FetchRegistrySpec ¶
FetchRegistrySpec fetches the registry spec.
func (*Fs) IsOverride ¶
IsOverride is true if this registry an an override.
func (*Fs) MakeRegistryRefSpec ¶
func (fs *Fs) MakeRegistryRefSpec() *app.RegistryRefSpec
MakeRegistryRefSpec returns an app registry ref spec.
func (*Fs) RegistrySpecDir ¶
RegistrySpecDir is the registry directory.
func (*Fs) RegistrySpecFilePath ¶
RegistrySpecFilePath is the path for the registry.yaml
func (*Fs) ResolveLibrary ¶
func (fs *Fs) ResolveLibrary(partName, partAlias, libRefSpec string, onFile ResolveFile, onDir ResolveDirectory) (*parts.Spec, *app.LibraryRefSpec, error)
ResolveLibrary fetches the part and creates a parts spec and library ref spec.
func (*Fs) ResolveLibrarySpec ¶
ResolveLibrarySpec returns a resolved spec for a part. `libRefSpec` is ignored.
type GitHub ¶
type GitHub struct {
// contains filtered or unexported fields
}
GitHub is a Github Registry
func (*GitHub) FetchRegistrySpec ¶
FetchRegistrySpec fetches the registry spec.
func (*GitHub) IsOverride ¶
IsOverride is true if this registry an an override.
func (*GitHub) MakeRegistryRefSpec ¶
func (gh *GitHub) MakeRegistryRefSpec() *app.RegistryRefSpec
MakeRegistryRefSpec returns an app registry ref spec.
func (*GitHub) RegistrySpecDir ¶
RegistrySpecDir is the registry directory.
func (*GitHub) RegistrySpecFilePath ¶
RegistrySpecFilePath is the path for the registry.yaml
func (*GitHub) ResolveLibrary ¶
func (gh *GitHub) ResolveLibrary(partName, partAlias, libRefSpec string, onFile ResolveFile, onDir ResolveDirectory) (*parts.Spec, *app.LibraryRefSpec, error)
ResolveLibrary fetches the part and creates a parts spec and library ref spec.
func (*GitHub) ResolveLibrarySpec ¶
ResolveLibrarySpec returns a resolved spec for a part.
type GitHubOpt ¶
type GitHubOpt func(*GitHub)
GitHubOpt is an option for configuring GitHub.
func GitHubClient ¶
GitHubClient is an option for the setting a github client.
type LibraryRef ¶
LibraryRef is library reference.
type LibraryRefSpecs ¶
type LibraryRefSpecs map[string]*LibraryRef
LibraryRefSpecs maps LibraryRefs to a name.
type Registry ¶
type Registry interface { RegistrySpecDir() string RegistrySpecFilePath() string FetchRegistrySpec() (*Spec, error) MakeRegistryRefSpec() *app.RegistryRefSpec ResolveLibrarySpec(libID, libRefSpec string) (*parts.Spec, error) ResolveLibrary(libID, libAlias, version string, onFile ResolveFile, onDir ResolveDirectory) (*parts.Spec, *app.LibraryRefSpec, error) Name() string Protocol() string URI() string IsOverride() bool }
Registry is a Registry
type ResolveDirectory ¶
ResolveDirectory resolves directories when searching a part.
type ResolveFile ¶
ResolveFile resolves files found when searching a part.
type Spec ¶
type Spec struct { APIVersion string `json:"apiVersion"` Kind string `json:"kind"` GitVersion *app.GitVersionSpec `json:"gitVersion"` Libraries LibraryRefSpecs `json:"libraries"` }
Spec describes how a registry is stored.