Documentation ¶
Index ¶
- type GitInterfaceProvider
- type GitProvider
- func (p *GitProvider) Apply(path string, ref interface{}, content []byte) (interface{}, error)
- func (p *GitProvider) Commit(ctx context.Context, ref interface{}) error
- func (p *GitProvider) Create(name string, ref interface{}, content []byte) (interface{}, error)
- func (p *GitProvider) Delete(path string, ref interface{}, content []byte) (interface{}, error)
- func (p *GitProvider) Get(name string, gvkRes []byte) ([]byte, error)
- func (p *GitProvider) GetPath(t string) string
- func (p *GitProvider) IsReachable() error
- func (p *GitProvider) StartClusterWatcher(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitInterfaceProvider ¶
type GitInterfaceProvider interface { AddToCommit(fileName, content string, ref interface{}) interface{} DeleteToCommit(fileName string, ref interface{}) interface{} CommitFiles(app, message string, files interface{}) error ClusterWatcher(ctx context.Context, cid, app, cluster string, waitTime int) error }
type GitProvider ¶
type GitProvider struct { Cid string Cluster string App string Namespace string Level string GitType string GitToken string UserName string Branch string RepoName string Url string // contains filtered or unexported fields }
func NewGitProvider ¶
func NewGitProvider(ctx context.Context, cid, app, cluster, level, namespace string) (*GitProvider, error)
Function to create a New gitProvider params : cid, app, cluster, level, namespace string return : GitProvider, error
func (*GitProvider) Apply ¶
func (p *GitProvider) Apply(path string, ref interface{}, content []byte) (interface{}, error)
Function to apply resource to the cluster params : name string, ref interface{}, content []byte return : interface{}, error
func (*GitProvider) Commit ¶
func (p *GitProvider) Commit(ctx context.Context, ref interface{}) error
Function to commit resources to the cluster params : ctx context.Context, ref interface{} return : error
func (*GitProvider) Create ¶
func (p *GitProvider) Create(name string, ref interface{}, content []byte) (interface{}, error)
Function to create a new resource if the not already existing params : name string, ref interface{}, content []byte return : interface{}, error
func (*GitProvider) Delete ¶
func (p *GitProvider) Delete(path string, ref interface{}, content []byte) (interface{}, error)
Function to delete resource from the cluster params : name string, ref interface{}, content []byte return : interface{}, error
func (*GitProvider) Get ¶
func (p *GitProvider) Get(name string, gvkRes []byte) ([]byte, error)
Function to get resource from the cluster params : name string, gvkRes []byte return : []byte, error
func (*GitProvider) GetPath ¶
func (p *GitProvider) GetPath(t string) string
Function to get path of files stored in git params : string return : string
func (*GitProvider) IsReachable ¶
func (p *GitProvider) IsReachable() error
Function for cluster reachablity test params : null return : error
func (*GitProvider) StartClusterWatcher ¶
func (p *GitProvider) StartClusterWatcher(ctx context.Context) error
StartClusterWatcher watches for CR changes in git location go routine starts and reads after waitTime Thread exists when the AppContext is deleted