choreo

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 55 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDir

func EnsureDir(dirname string) error

func Exists

func Exists(filepath string) bool

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 BranchCtx

type BranchCtx struct {
	State    State
	Branch   string
	APIStore *api.APIStore
}

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) GetStore

func (r *BranchStore) GetStore() store.Storer[*BranchCtx]

func (*BranchStore) Update

func (r *BranchStore) Update(ctx context.Context, branches []*branchpb.BranchObject) error

func (*BranchStore) UpdateBranchCtx added in v0.0.15

func (r *BranchStore) UpdateBranchCtx(branchCtx *BranchCtx) error

func (*BranchStore) WatchAPIResources

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
}

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) String

func (r *CheckedOut) String() string

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)
	GetRootChoreoInstance() instance.ChoreoInstance
	GetBranchStore() *BranchStore
	Runner() Runner
	SnapshotManager() *SnapshotManager
	// updates resource (yaml) in the input directory
	Store(obj runtime.Unstructured) error
	// remove resource (yaml) from the input directory
	Destroy(obj runtime.Unstructured) error

	GetClient() resourceclient.Client
	GetContext() context.Context
	GetStatus() *Status
	GetConfig() *genericclioptions.ChoreoConfig
}

type ChoreoStatus added in v0.0.9

type ChoreoStatus struct {
	Status             bool
	Reason             string
	RootChoreoInstance instance.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

type Config added in v0.0.9

type Config struct {
	*unstructured.Unstructured
}

func (*Config) GetConfigs added in v0.0.15

func (u *Config) GetConfigs() []any

type ConfigValidator added in v0.0.15

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

func NewConfigValidator added in v0.0.15

func NewConfigValidator(choreo Choreo) *ConfigValidator

type Event

type Event int
const (
	Activate Event = iota
	DeActivate
)

func (Event) String

func (r Event) String() string

type Node added in v0.0.15

type Node struct {
	*unstructured.Unstructured
}

func (*Node) GetPlatformType added in v0.0.15

func (r *Node) GetPlatformType() string

func (*Node) GetProvider added in v0.0.15

func (r *Node) GetProvider() string

func (*Node) GetVersion added in v0.0.15

func (r *Node) GetVersion() string

type NodeConfig added in v0.0.15

type NodeConfig struct {
	Node          *Node
	RunningConfig any                          // json struct
	Configs       []*unstructured.Unstructured // json struct
}

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) String

func (r *NotCheckedOut) String() string

type Runner added in v0.0.9

type Runner interface {
	//AddResourceClientAndContext(ctx context.Context, client resourceclient.Client)
	Start(ctx context.Context, bctx *BranchCtx) (*runnerpb.Start_Response, error)
	Stop()
	RunOnce(ctx context.Context, bctx *BranchCtx, stream runnerpb.Runner_OnceServer) error
	Load(ctx context.Context, bctx *BranchCtx) error
}

func NewRunner added in v0.0.9

func NewRunner(choreo Choreo) Runner

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 Snapshot added in v0.0.11

type Snapshot struct {
	ID           string
	CreatedAt    time.Time
	APIResources []*discoverypb.APIResource
	//Input
	Inventory   inventory.Inventory
	RunResponse *runnerpb.Once_Response_RunResponse
}

type SnapshotManager added in v0.0.11

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

func NewSnapshotManager added in v0.0.11

func NewSnapshotManager() *SnapshotManager

func (*SnapshotManager) Create added in v0.0.11

func (r *SnapshotManager) Create(id string, apiResources []*discoverypb.APIResource, inventory inventory.Inventory, rsp *runnerpb.Once_Response_RunResponse)

func (*SnapshotManager) Delete added in v0.0.11

func (*SnapshotManager) Diff added in v0.0.11

func (*SnapshotManager) Get added in v0.0.11

func (*SnapshotManager) List added in v0.0.11

func (*SnapshotManager) Result added in v0.0.17

type SnapshotNode added in v0.0.11

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

type State

type State interface {
	String() string
	Activate(ctx context.Context, branchCtx *BranchCtx) error
	DeActivate(ctx context.Context, branchCtx *BranchCtx) error
}

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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