compass

package
v0.0.0-...-a52e8f6 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

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"`
	APIDefinitions   *graphql.APIDefinitionPage   `json:"apiDefinitions"`
	EventDefinitions *graphql.EventDefinitionPage `json:"eventDefinitions"`
	Documents        *graphql.DocumentPage        `json:"documents"`
}

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) CleanupTestsScenario

func (c *Client) CleanupTestsScenario() error

func (*Client) CreateAPI

func (c *Client) CreateAPI(appId string, input graphql.APIDefinitionInput) (*graphql.APIDefinition, error)

func (*Client) CreateApplication

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

func (*Client) CreateEventAPI

func (c *Client) CreateEventAPI(appId string, input graphql.EventDefinitionInput) (*graphql.EventDefinition, error)

func (*Client) DeleteAPI

func (c *Client) DeleteAPI(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.OneTimeToken, 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) UpdateAPI

func (c *Client) UpdateAPI(apiId string, input graphql.APIDefinitionInput) (*graphql.APIDefinition, 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.EventDefinition, 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)

Jump to

Keyboard shortcuts

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