choreo

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 26 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

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, error)

func (*BranchStore) Delete

func (r *BranchStore) Delete(ctx context.Context, branchSet repository.BranchSet) error

func (*BranchStore) GetStore

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

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 (*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) 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 (*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 (*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 {
	Start(ctx context.Context)
	GetMainChoreoInstance() ChoreoInstance
	GetBranchStore() *BranchStore
}

func New

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
}

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, path string, flags *genericclioptions.ConfigFlags) (ChoreoInstance, error)

type Event

type Event int
const (
	Activate Event = iota
	DeActivate
)

func (Event) String

func (r Event) String() string

type MainChoreoInstance

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

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 (*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 (*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 Reconciler

type Reconciler interface {
	Start(ctx context.Context)
	Stop()
}

No longer used, we decided that apis should always be loaded through files/git

func NewAPIReconciler

func NewAPIReconciler(
	choreoInstance ChoreoInstance,
	client resourceclient.Client,
	branch string,
	apiStore *api.APIStore,
) Reconciler

type State

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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