Documentation
¶
Index ¶
- Constants
- func GetCapabilitiesFromCluster(ctx context.Context, namespace string, c client.Client, syncDir string, ...) ([]types.Capability, error)
- func GetInstalledCapabilityWithCapAlias(capT types.CapType, capAlias string) (types.Capability, error)
- func GetSubDir(dir string, capT types.CapType) string
- func GetTraitsFromCluster(ctx context.Context, namespace string, c client.Client, syncDir string, ...) ([]types.Capability, error)
- func GetWorkloadsFromCluster(ctx context.Context, namespace string, c client.Client, syncDir string, ...) ([]types.Capability, error)
- func HandleDefinition(name, syncDir, crdName string, extention *runtime.RawExtension, ...) (types.Capability, error)
- func HandleTemplate(in *runtime.RawExtension, name, syncDir string) (types.Capability, error)
- func LoadAllInstalledCapability() ([]types.Capability, error)
- func LoadCapabilityByName(name string) (types.Capability, error)
- func LoadCapabilityFromSyncedCenter(dir string) ([]types.Capability, error)
- func LoadInstalledCapabilityWithType(capT types.CapType) ([]types.Capability, error)
- func ParseAndSyncCapability(data []byte, syncDir string) (types.Capability, error)
- func SinkTemp2Local(templates []types.Capability, dir string) int
- func StoreRepos(repos []CapCenterConfig) error
- type CapCenterConfig
- type CenterClient
- type GithubCenter
- type GithubContent
- type RemoteCapabilities
- type RemoteCapability
Constants ¶
View Source
const TypeGithub = "github"
View Source
const TypeUnknown = "unknown"
Variables ¶
This section is empty.
Functions ¶
func GetCapabilitiesFromCluster ¶
func GetCapabilitiesFromCluster(ctx context.Context, namespace string, c client.Client, syncDir string, selector labels.Selector) ([]types.Capability, error)
func GetInstalledCapabilityWithCapAlias ¶
func GetInstalledCapabilityWithCapAlias(capT types.CapType, capAlias string) (types.Capability, error)
func GetTraitsFromCluster ¶
func GetTraitsFromCluster(ctx context.Context, namespace string, c client.Client, syncDir string, selector labels.Selector) ([]types.Capability, error)
func GetWorkloadsFromCluster ¶
func GetWorkloadsFromCluster(ctx context.Context, namespace string, c client.Client, syncDir string, selector labels.Selector) ([]types.Capability, error)
func HandleDefinition ¶
func HandleDefinition(name, syncDir, crdName string, extention *runtime.RawExtension, tp types.CapType, applyTo []string) (types.Capability, error)
func HandleTemplate ¶
func HandleTemplate(in *runtime.RawExtension, name, syncDir string) (types.Capability, error)
func LoadAllInstalledCapability ¶
func LoadAllInstalledCapability() ([]types.Capability, error)
func LoadCapabilityByName ¶
func LoadCapabilityByName(name string) (types.Capability, error)
func LoadCapabilityFromSyncedCenter ¶
func LoadCapabilityFromSyncedCenter(dir string) ([]types.Capability, error)
func LoadInstalledCapabilityWithType ¶
func LoadInstalledCapabilityWithType(capT types.CapType) ([]types.Capability, error)
func ParseAndSyncCapability ¶
func ParseAndSyncCapability(data []byte, syncDir string) (types.Capability, error)
func SinkTemp2Local ¶
func SinkTemp2Local(templates []types.Capability, dir string) int
func StoreRepos ¶
func StoreRepos(repos []CapCenterConfig) error
Types ¶
type CapCenterConfig ¶
type CapCenterConfig struct {
Name string `json:"name"`
Address string `json:"address"`
Token string `json:"token"`
}
CapCenterConfig is used to store cap center config in file
type CenterClient ¶
type CenterClient interface {
SyncCapabilityFromCenter() error
}
func NewCenterClient ¶
func NewCenterClient(ctx context.Context, name, address, token string) (CenterClient, error)
type GithubCenter ¶
type GithubCenter struct {
// contains filtered or unexported fields
}
func NewGithubCenter ¶
func NewGithubCenter(ctx context.Context, token, centerName string, r *GithubContent) (*GithubCenter, error)
func (*GithubCenter) SyncCapabilityFromCenter ¶
func (g *GithubCenter) SyncCapabilityFromCenter() error
TODO(wonderflow): currently we only sync by create, we also need to delete which not exist remotely.
type GithubContent ¶
type GithubContent struct {
Owner string `json:"owner"`
Repo string `json:"repo"`
Path string `json:"path"`
Ref string `json:"ref"`
}
type RemoteCapabilities ¶
type RemoteCapabilities []RemoteCapability
type RemoteCapability ¶
type RemoteCapability struct {
// Name MUST be xxx.yaml
Name string `json:"name"`
URL string `json:"download_url"`
Sha string `json:"sha"`
// Type MUST be file
Type string `json:"type"`
}
Click to show internal directories.
Click to hide internal directories.