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 GetTraitsFromCluster ¶
func GetWorkloadsFromCluster ¶
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
func LoadRepos ¶
func LoadRepos() ([]CapCenterConfig, error)
TODO(wonderflow): we can make default(built-in) repo configurable, then we should make default inside the answer
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 RemoteCapabilities ¶
type RemoteCapabilities []RemoteCapability
Click to show internal directories.
Click to hide internal directories.