Documentation

Index

Constants

View Source
const (
	TenantHeader        = "Tenant"
	ScenariosLabelName  = "scenarios"
	AuthorizationHeader = "Authorization"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	ID          string                  `json:"id"`
	Name        string                  `json:"name"`
	Description *string                 `json:"description"`
	Labels      map[string]interface{}  `json:"labels"`
	Packages    *graphql.PackagePageExt `json:"packages"`
}

func (Application) GetContext

func (a Application) GetContext() string

    GetContext is a helper function that returns Application ID and Name in well formatted string (for logging)

    type Client

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

    func NewCompassClient

    func NewCompassClient(endpoint, tenant, runtimeId, scenarioLabel string, gqlLog bool) *Client

    func (*Client) AddAPIDefinitionToPackage

    func (c *Client) AddAPIDefinitionToPackage(packageID string, input graphql.APIDefinitionInput) (*graphql.APIDefinitionExt, error)

    func (*Client) AddAPIPackage

    func (c *Client) AddAPIPackage(appId string, input graphql.PackageCreateInput) (graphql.PackageExt, error)

    func (*Client) AddEventAPIToPackage

    func (c *Client) AddEventAPIToPackage(packageId string, input graphql.EventDefinitionInput) (*graphql.EventAPIDefinitionExt, error)

    func (*Client) CleanupTestsScenario

    func (c *Client) CleanupTestsScenario() error

    func (*Client) CreateApplication

    func (c *Client) CreateApplication(input graphql.ApplicationRegisterInput) (Application, error)

    func (*Client) DeleteAPIDefinition

    func (c *Client) DeleteAPIDefinition(id string) (string, error)

    func (*Client) DeleteAPIPackage

    func (c *Client) DeleteAPIPackage(id string) (string, error)

    func (*Client) DeleteApplication

    func (c *Client) DeleteApplication(id string) (string, error)

    func (*Client) DeleteEventAPI

    func (c *Client) DeleteEventAPI(id string) (string, error)

    func (*Client) GetOneTimeTokenForApplication

    func (c *Client) GetOneTimeTokenForApplication(applicationId string) (graphql.TokenWithURL, error)

    func (*Client) GetRuntime

    func (c *Client) GetRuntime(runtimeId string) (Runtime, error)

    func (*Client) SetDirectorToken

    func (c *Client) SetDirectorToken(directorToken string)

    func (*Client) SetupTestsScenario

    func (c *Client) SetupTestsScenario() error

    func (*Client) UpdateAPIDefinition

    func (c *Client) UpdateAPIDefinition(apiId string, input graphql.APIDefinitionInput) (*graphql.APIDefinitionExt, error)

    func (*Client) UpdateAPIPackage

    func (c *Client) UpdateAPIPackage(id string, input graphql.PackageUpdateInput) (graphql.PackageExt, error)

    func (*Client) UpdateApplication

    func (c *Client) UpdateApplication(applicationId string, input graphql.ApplicationUpdateInput) (Application, error)

    func (*Client) UpdateEventAPI

    func (c *Client) UpdateEventAPI(apiId string, input graphql.EventDefinitionInput) (*graphql.EventAPIDefinitionExt, error)

    type IdResponse

    type IdResponse struct {
    	Id string `json:"id"`
    }

    type Runtime

    type Runtime struct {
    	graphql.Runtime
    	Labels graphql.Labels `json:"labels"`
    }

    type ScenarioLabelDefinition

    type ScenarioLabelDefinition struct {
    	Key    string              `json:"key"`
    	Schema *graphql.JSONSchema `json:"schema"`
    }

    type ScenariosItems

    type ScenariosItems struct {
    	Type string   `json:"type"`
    	Enum []string `json:"enum"`
    }

    type ScenariosSchema

    type ScenariosSchema struct {
    	Type        string         `json:"type"`
    	MinItems    int            `json:"minItems"`
    	UniqueItems bool           `json:"uniqueItems"`
    	Items       ScenariosItems `json:"items"`
    }

    func ToScenarioSchema

    func ToScenarioSchema(scenarioLabelDefinition ScenarioLabelDefinition) (ScenariosSchema, error)

    func (*ScenariosSchema) AddScenario

    func (ss *ScenariosSchema) AddScenario(value string)

    func (*ScenariosSchema) RemoveScenario

    func (ss *ScenariosSchema) RemoveScenario(value string)

    func (*ScenariosSchema) ToLabelDefinitionInput

    func (ss *ScenariosSchema) ToLabelDefinitionInput(key string) (graphql.LabelDefinitionInput, error)