Documentation ¶
Index ¶
- Constants
- func GetEndpoint(agentType string) (string, error)
- func GetK8sInfraYaml(infra dbChaosInfra.ChaosInfra) ([]byte, error)
- func InfraCreateJWT(id string) (string, error)
- func InfraValidateJWT(token string) (string, error)
- func ManifestParser(infra dbChaosInfra.ChaosInfra, rootPath string, ...) ([]byte, error)
- func SendExperimentToSubscriber(projectID string, workflow *model.ChaosExperimentRequest, username *string, ...)
- func SendRequestToSubscriber(subscriberRequest SubscriberRequests, r store.StateData)
- type KubeObjData
- type ObjectData
- type PodLogData
- type Service
- type SubscriberConfigurations
- type SubscriberRequests
Constants ¶
View Source
const ( // CIVersion specifies the version tag used for ci builds CIVersion = "ci" ClusterScope string = "cluster" NamespaceScope string = "namespace" )
Variables ¶
This section is empty.
Functions ¶
func GetEndpoint ¶
func GetK8sInfraYaml ¶
func GetK8sInfraYaml(infra dbChaosInfra.ChaosInfra) ([]byte, error)
func InfraCreateJWT ¶
InfraCreateJWT generates jwt used in chaos_infra registration
func InfraValidateJWT ¶
InfraValidateJWT validates the chaos_infra jwt
func ManifestParser ¶
func ManifestParser(infra dbChaosInfra.ChaosInfra, rootPath string, config *SubscriberConfigurations) ([]byte, error)
ManifestParser parses manifests yaml and generates dynamic manifest with specified keys
func SendExperimentToSubscriber ¶
func SendExperimentToSubscriber(projectID string, workflow *model.ChaosExperimentRequest, username *string, externalData *string, reqType string, r *store.StateData)
SendExperimentToSubscriber sends the workflow to the subscriber to be handled
func SendRequestToSubscriber ¶
func SendRequestToSubscriber(subscriberRequest SubscriberRequests, r store.StateData)
SendRequestToSubscriber sends events from the graphQL server to the subscribers listening for the requests
Types ¶
type KubeObjData ¶
type KubeObjData struct { Namespace string `json:"namespace"` Data []ObjectData `json:"data"` }
type ObjectData ¶
type ObjectData struct { Name string `json:"name"` UID types.UID `json:"uid"` Namespace string `json:"namespace"` APIVersion string `json:"apiVersion"` CreationTimestamp metav1.Time `json:"creationTimestamp"` Containers []v1.Container `json:"containers"` TerminationGracePeriods *int64 `json:"terminationGracePeriods"` Volumes []v1.Volume `json:"volumes"` Labels map[string]string `json:"labels"` }
type PodLogData ¶
type Service ¶
type Service interface { RegisterInfra(c context.Context, projectID string, input model.RegisterInfraRequest) (*model.RegisterInfraResponse, error) ConfirmInfraRegistration(request model.InfraIdentity, r store.StateData) (*model.ConfirmInfraRegistrationResponse, error) VerifyInfra(identity model.InfraIdentity) (*dbChaosInfra.ChaosInfra, error) //NewClusterEvent(request model.NewClusterEventRequest, r store.StateData) (string, error) DeleteInfra(ctx context.Context, projectID string, infraId string, r store.StateData) (string, error) ListInfras(projectID string, request *model.ListInfraRequest) (*model.ListInfraResponse, error) GetInfraDetails(ctx context.Context, infraID string, projectID string) (*model.Infra, error) SendInfraEvent(eventType, eventName, description string, infra model.Infra, r store.StateData) GetManifest(token string) ([]byte, int, error) GetManifestWithInfraID(infraID string, accessKey string) ([]byte, error) GetInfra(ctx context.Context, projectID string, infraID string) (*model.Infra, error) GetInfraStats(ctx context.Context, projectID string) (*model.GetInfraStatsResponse, error) GetVersionDetails() (*model.InfraVersionDetails, error) QueryServerVersion(ctx context.Context) (*model.ServerVersionResponse, error) PodLog(request model.PodLog, r store.StateData) (string, error) KubeObj(request model.KubeObjectData, r store.StateData) (string, error) UpdateInfra(query bson.D, update bson.D) error GetDBInfra(infraID string) (dbChaosInfra.ChaosInfra, error) }
func NewChaosInfrastructureService ¶
func NewChaosInfrastructureService(infraOperator *dbChaosInfra.Operator, envOperator *dbEnvironments.Operator) Service
NewChaosInfrastructureService returns a new instance of Service
type SubscriberRequests ¶
type SubscriberRequests struct { RequestType string `json:"request_type"` K8sManifest string `json:"k8s_manifest"` ExternalData *string `json:"external_data"` ProjectID string `json:"project_id"` InfraID string `json:"infra_id"` Namespace string `json:"namespace"` Username *string `json:"username"` }
SubscriberRequests contains the required configurable parameters for the requests sent to the subscriber
Click to show internal directories.
Click to hide internal directories.