Documentation ¶
Index ¶
- Constants
- func EnsureDir(dirname string) error
- func Exists(filepath string) bool
- func HasAPIResource(apiResources []*discoverypb.APIResource, gvk schema.GroupVersionKind) bool
- func PrintAPIResource(apiResources []*discoverypb.APIResource) bool
- type BranchCtx
- type BranchStore
- func (r *BranchStore) Delete(ctx context.Context, branchSet repository.BranchSet) error
- func (r *BranchStore) GetCheckedOut() (*BranchCtx, error)
- func (r *BranchStore) GetStore() store.Storer[*BranchCtx]
- func (r *BranchStore) LoadData(ctx context.Context, branch string) error
- func (r *BranchStore) Update(ctx context.Context, branches []*branchpb.BranchObject) error
- func (r *BranchStore) WatchAPIResources(ctx context.Context, opts ...resourceclient.ListOption) (watch.WatchInterface[*api.ResourceContext], error)
- func (r *BranchStore) WatchBranches(ctx context.Context, opts ...store.ListOption) (watch.WatchInterface[*BranchCtx], error)
- type CheckedOut
- func (r *CheckedOut) Activate(ctx context.Context, branchCtx *BranchCtx) error
- func (r *CheckedOut) DeActivate(_ context.Context, branchCtx *BranchCtx) error
- func (r *CheckedOut) GetCommit() *object.Commit
- func (r *CheckedOut) LoadData(ctx context.Context, branchCtx *BranchCtx) error
- func (r *CheckedOut) String() string
- type ChildChoreoInstance
- func (r *ChildChoreoInstance) Destroy() error
- func (r *ChildChoreoInstance) GetAPIClient() resourceclient.Client
- func (r *ChildChoreoInstance) GetAPIStore() *api.APIStore
- func (r *ChildChoreoInstance) GetAnnotationVal() string
- func (r *ChildChoreoInstance) GetCommit() *object.Commit
- func (r *ChildChoreoInstance) GetDBPath() string
- func (r *ChildChoreoInstance) GetFlags() *genericclioptions.ConfigFlags
- func (r *ChildChoreoInstance) GetName() string
- func (r *ChildChoreoInstance) GetPath() string
- func (r *ChildChoreoInstance) GetPathInRepo() string
- func (r *ChildChoreoInstance) GetRepo() repository.Repository
- func (r *ChildChoreoInstance) GetRepoPath() string
- func (r *ChildChoreoInstance) GetTempPath() string
- func (r *ChildChoreoInstance) LoadInternalAPIs() error
- type Choreo
- type ChoreoInstance
- type ChoreoStatus
- type Config
- type Event
- type MainChoreoInstance
- func (r *MainChoreoInstance) Destroy() error
- func (r *MainChoreoInstance) GetAPIClient() resourceclient.Client
- func (r *MainChoreoInstance) GetAPIStore() *api.APIStore
- func (r *MainChoreoInstance) GetAnnotationVal() string
- func (r *MainChoreoInstance) GetCommit() *object.Commit
- func (r *MainChoreoInstance) GetDBPath() string
- func (r *MainChoreoInstance) GetFlags() *genericclioptions.ConfigFlags
- func (r *MainChoreoInstance) GetName() string
- func (r *MainChoreoInstance) GetPath() string
- func (r *MainChoreoInstance) GetPathInRepo() string
- func (r *MainChoreoInstance) GetRepo() repository.Repository
- func (r *MainChoreoInstance) GetRepoPath() string
- func (r *MainChoreoInstance) GetTempPath() string
- func (r *MainChoreoInstance) LoadInternalAPIs() error
- type NotCheckedOut
- func (r *NotCheckedOut) Activate(ctx context.Context, branchCtx *BranchCtx) error
- func (r *NotCheckedOut) DeActivate(_ context.Context, branchCtx *BranchCtx) error
- func (r *NotCheckedOut) GetCommit() *object.Commit
- func (r *NotCheckedOut) LoadData(_ context.Context, branchCtx *BranchCtx) error
- func (r *NotCheckedOut) String() string
- type Runner
- type RunnerStatus
- type State
- type Status
Constants ¶
View Source
const DummyBranch = "dummy"
Variables ¶
This section is empty.
Functions ¶
func HasAPIResource ¶ added in v0.0.9
func HasAPIResource(apiResources []*discoverypb.APIResource, gvk schema.GroupVersionKind) bool
func PrintAPIResource ¶ added in v0.0.9
func PrintAPIResource(apiResources []*discoverypb.APIResource) bool
Types ¶
type BranchStore ¶
type BranchStore struct {
// contains filtered or unexported fields
}
func NewBranchStore ¶
func NewBranchStore(choreo *choreo) *BranchStore
func (*BranchStore) Delete ¶
func (r *BranchStore) Delete(ctx context.Context, branchSet repository.BranchSet) error
func (*BranchStore) GetCheckedOut ¶ added in v0.0.9
func (r *BranchStore) GetCheckedOut() (*BranchCtx, error)
func (*BranchStore) LoadData ¶
func (r *BranchStore) LoadData(ctx context.Context, branch string) error
func (*BranchStore) Update ¶
func (r *BranchStore) Update(ctx context.Context, branches []*branchpb.BranchObject) error
func (*BranchStore) WatchAPIResources ¶
func (r *BranchStore) WatchAPIResources(ctx context.Context, opts ...resourceclient.ListOption) (watch.WatchInterface[*api.ResourceContext], error)
func (*BranchStore) WatchBranches ¶
func (r *BranchStore) WatchBranches(ctx context.Context, opts ...store.ListOption) (watch.WatchInterface[*BranchCtx], error)
type CheckedOut ¶
type CheckedOut struct { Choreo *choreo Client resourceclient.Client ChildChoreoInstances []ChoreoInstance }
func (*CheckedOut) Activate ¶
func (r *CheckedOut) Activate(ctx context.Context, branchCtx *BranchCtx) error
func (*CheckedOut) DeActivate ¶
func (r *CheckedOut) DeActivate(_ context.Context, branchCtx *BranchCtx) error
func (*CheckedOut) GetCommit ¶
func (r *CheckedOut) GetCommit() *object.Commit
func (*CheckedOut) LoadData ¶
func (r *CheckedOut) LoadData(ctx context.Context, branchCtx *BranchCtx) error
func (*CheckedOut) String ¶
func (r *CheckedOut) String() string
type ChildChoreoInstance ¶
type ChildChoreoInstance struct {
// contains filtered or unexported fields
}
func (*ChildChoreoInstance) Destroy ¶ added in v0.0.9
func (r *ChildChoreoInstance) Destroy() error
func (*ChildChoreoInstance) GetAPIClient ¶
func (r *ChildChoreoInstance) GetAPIClient() resourceclient.Client
func (*ChildChoreoInstance) GetAPIStore ¶
func (r *ChildChoreoInstance) GetAPIStore() *api.APIStore
func (*ChildChoreoInstance) GetAnnotationVal ¶
func (r *ChildChoreoInstance) GetAnnotationVal() string
func (*ChildChoreoInstance) GetCommit ¶
func (r *ChildChoreoInstance) GetCommit() *object.Commit
func (*ChildChoreoInstance) GetDBPath ¶
func (r *ChildChoreoInstance) GetDBPath() string
func (*ChildChoreoInstance) GetFlags ¶
func (r *ChildChoreoInstance) GetFlags() *genericclioptions.ConfigFlags
func (*ChildChoreoInstance) GetName ¶
func (r *ChildChoreoInstance) GetName() string
func (*ChildChoreoInstance) GetPath ¶
func (r *ChildChoreoInstance) GetPath() string
func (*ChildChoreoInstance) GetPathInRepo ¶
func (r *ChildChoreoInstance) GetPathInRepo() string
func (*ChildChoreoInstance) GetRepo ¶
func (r *ChildChoreoInstance) GetRepo() repository.Repository
func (*ChildChoreoInstance) GetRepoPath ¶
func (r *ChildChoreoInstance) GetRepoPath() string
func (*ChildChoreoInstance) GetTempPath ¶
func (r *ChildChoreoInstance) GetTempPath() string
func (*ChildChoreoInstance) LoadInternalAPIs ¶
func (r *ChildChoreoInstance) LoadInternalAPIs() error
type Choreo ¶
type Choreo interface { Get(ctx context.Context, req *choreopb.Get_Request) (*choreopb.Get_Response, error) Apply(ctx context.Context, req *choreopb.Apply_Request) (*choreopb.Apply_Response, error) Start(ctx context.Context) GetMainChoreoInstance() ChoreoInstance GetBranchStore() *BranchStore Runner() Runner // updates resource (yaml) in the input directory Store(obj runtime.Unstructured) error // remove resource (yaml) from the input directory Destroy(obj runtime.Unstructured) error }
func New ¶
func New(flags *genericclioptions.ConfigFlags) Choreo
type ChoreoInstance ¶
type ChoreoInstance interface { GetName() string GetRepo() repository.Repository GetRepoPath() string GetPath() string GetTempPath() string GetPathInRepo() string GetDBPath() string GetFlags() *genericclioptions.ConfigFlags GetAPIStore() *api.APIStore // provides the internal apistore GetCommit() *object.Commit GetAPIClient() resourceclient.Client GetAnnotationVal() string Destroy() error }
func NewChildChoreoInstance ¶
func NewChildChoreoInstance(ctx context.Context, repo repository.Repository, pathInRepo string, flags *genericclioptions.ConfigFlags, commit *object.Commit, annotationVal string) (ChoreoInstance, error)
func NewMainChoreoInstance ¶
func NewMainChoreoInstance(ctx context.Context, config *Config) (ChoreoInstance, error)
type ChoreoStatus ¶ added in v0.0.9
type ChoreoStatus struct { Status bool Reason string MainChoreoInstance ChoreoInstance ChoreoCtx *choreopb.ChoreoContext }
func Failed ¶ added in v0.0.9
func Failed(msg string) ChoreoStatus
func Initializing ¶ added in v0.0.9
func Initializing() ChoreoStatus
func Success ¶ added in v0.0.9
func Success(c ChoreoInstance, choreoCtx *choreopb.ChoreoContext) ChoreoStatus
type Config ¶ added in v0.0.9
type Config struct { Path string Repo repository.Repository Commit *object.Commit PathInRepo string Flags *genericclioptions.ConfigFlags }
type MainChoreoInstance ¶
type MainChoreoInstance struct {
// contains filtered or unexported fields
}
func (*MainChoreoInstance) Destroy ¶ added in v0.0.9
func (r *MainChoreoInstance) Destroy() error
func (*MainChoreoInstance) GetAPIClient ¶
func (r *MainChoreoInstance) GetAPIClient() resourceclient.Client
func (*MainChoreoInstance) GetAPIStore ¶
func (r *MainChoreoInstance) GetAPIStore() *api.APIStore
func (*MainChoreoInstance) GetAnnotationVal ¶
func (r *MainChoreoInstance) GetAnnotationVal() string
func (*MainChoreoInstance) GetCommit ¶
func (r *MainChoreoInstance) GetCommit() *object.Commit
func (*MainChoreoInstance) GetDBPath ¶
func (r *MainChoreoInstance) GetDBPath() string
func (*MainChoreoInstance) GetFlags ¶
func (r *MainChoreoInstance) GetFlags() *genericclioptions.ConfigFlags
func (*MainChoreoInstance) GetName ¶
func (r *MainChoreoInstance) GetName() string
func (*MainChoreoInstance) GetPath ¶
func (r *MainChoreoInstance) GetPath() string
func (*MainChoreoInstance) GetPathInRepo ¶
func (r *MainChoreoInstance) GetPathInRepo() string
func (*MainChoreoInstance) GetRepo ¶
func (r *MainChoreoInstance) GetRepo() repository.Repository
func (*MainChoreoInstance) GetRepoPath ¶
func (r *MainChoreoInstance) GetRepoPath() string
func (*MainChoreoInstance) GetTempPath ¶
func (r *MainChoreoInstance) GetTempPath() string
func (*MainChoreoInstance) LoadInternalAPIs ¶
func (r *MainChoreoInstance) LoadInternalAPIs() error
type NotCheckedOut ¶
type NotCheckedOut struct { Commit *object.Commit Choreo *choreo Client resourceclient.Client }
func (*NotCheckedOut) Activate ¶
func (r *NotCheckedOut) Activate(ctx context.Context, branchCtx *BranchCtx) error
func (*NotCheckedOut) DeActivate ¶
func (r *NotCheckedOut) DeActivate(_ context.Context, branchCtx *BranchCtx) error
func (*NotCheckedOut) GetCommit ¶
func (r *NotCheckedOut) GetCommit() *object.Commit
func (*NotCheckedOut) LoadData ¶
func (r *NotCheckedOut) LoadData(_ context.Context, branchCtx *BranchCtx) error
func (*NotCheckedOut) String ¶
func (r *NotCheckedOut) String() string
type Runner ¶ added in v0.0.9
type RunnerStatus ¶ added in v0.0.9
type RunnerStatus int
const ( RunnerStatus_Stopped RunnerStatus = iota RunnerStatus_Running RunnerStatus_Once )
func (RunnerStatus) String ¶ added in v0.0.9
func (rs RunnerStatus) String() string
type Status ¶ added in v0.0.9
type Status struct { ChoreoStatus // contains filtered or unexported fields }
func (*Status) Changed ¶ added in v0.0.9
func (r *Status) Changed(newChoreoCtx *choreopb.ChoreoContext) bool
func (*Status) Get ¶ added in v0.0.9
func (r *Status) Get() ChoreoStatus
func (*Status) Set ¶ added in v0.0.9
func (r *Status) Set(s ChoreoStatus)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.