Documentation ¶
Index ¶
Constants ¶
const CACAOFieldManager = "cacao-k8s-execution"
CACAOFieldManager is a field manager constant that we use to indicate changes are made by CACAO
Variables ¶
This section is empty.
Functions ¶
func SSHTunneledK8SConnection ¶
func SSHTunneledK8SConnection(config types.K8SConnectionConfig) (http.RoundTripper, io.Closer, error)
SSHTunneledK8SConnection connect to host via SSH and create a http.RoundTripper based on SSH tunnel. The SSH tunnel is returned as io.Closer, caller need to close it to avoid connection leaks.
Types ¶
type DeploymentMetadataService ¶
type DeploymentMetadataService struct {
// contains filtered or unexported fields
}
DeploymentMetadataService is a client to interact with deployment metadata service
func NewDeploymentMetadataService ¶
func NewDeploymentMetadataService(conn messaging2.QueryConnection) DeploymentMetadataService
NewDeploymentMetadataService ...
func (DeploymentMetadataService) Get ¶
func (svc DeploymentMetadataService) Get(actor service.Actor, id common.ID) (service.Deployment, error)
Get fetches a deployment by ID
type Event ¶
type Event cloudevents.Event
Event implements types.IncomingEvent & types.OutgoingEvent
func (Event) CloudEvent ¶
func (e Event) CloudEvent() cloudevents.Event
CloudEvent returns the event as a cloudevent
func (Event) ToCloudEvent ¶
func (e Event) ToCloudEvent(source string) (cloudevents.Event, error)
ToCloudEvent returns the event as a cloudevent with the specified source
func (Event) Transaction ¶
func (e Event) Transaction() common.TransactionID
Transaction returns the transaction ID
type GitAdapter ¶
type GitAdapter struct{}
GitAdapter ...
func (GitAdapter) Clone ¶
func (g GitAdapter) Clone(templateSrc service.TemplateSource, gitCredential *service.CredentialModel) ([]types.TemplateFile, string, error)
Clone clones the git repo. This returns a list of template files in the specified directory and commit hash of the HEAD.
type K8S ¶
type K8S struct{}
K8S is an adapter that apply/delete k8s resources defined in template files.
func (*K8S) Apply ¶
func (k8s *K8S) Apply(ctx context.Context, cfg *rest.Config, templateFiles []types.TemplateFile) error
Apply ...
type K8SConnector ¶
type K8SConnector struct { }
K8SConnector builds a "connection" to k8s cluster in the form of a REST config, this allows us to tunnel the connection via other protocol (e.g. SSH)
func (K8SConnector) BuildConnection ¶
func (kc K8SConnector) BuildConnection(config types.K8SConnectionConfig) (*rest.Config, io.Closer, error)
BuildConnection builds a connection to k8s api
func (K8SConnector) Ping ¶
func (kc K8SConnector) Ping(config types.K8SConnectionConfig) error
Ping builds a "connection" to test if config works.
type StanAdapter ¶
type StanAdapter struct {
// contains filtered or unexported fields
}
StanAdapter is an adapter for STAN that does both publishing and subscription
func NewStanAdapter ¶
func NewStanAdapter(conn messaging2.EventConnection) *StanAdapter
NewStanAdapter ...
func (*StanAdapter) Init ¶
func (src *StanAdapter) Init(conf types.Config) error
Init establish a STAN connection
func (*StanAdapter) Start ¶
func (src *StanAdapter) Start(ctx context.Context, wg *sync.WaitGroup, handlers ports.IncomingEventHandlers) error
Start starts STAN subscription and start receiving events