director

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewDirectorClient

func NewDirectorClient(ctx context.Context, config Config, log logrus.FieldLogger) *Client

NewDirectorClient returns new director client struct pointer

func (*Client) GetRuntimeID

func (dc *Client) GetRuntimeID(accountID, instanceID string) (string, error)

GetRuntimeID fetches runtime ID with given label name from director component

func (*Client) SetLabel

func (dc *Client) SetLabel(accountID, runtimeID, key, value string) error

SetLabel adds key-value label to a Runtime

type Config

type Config struct {
	URL               string `envconfig:"default=http://compass-director.compass-system.svc.cluster.local:3000/graphql"`
	OauthTokenURL     string `envconfig:"default=https://oauth.domain.com/oauth/token"`
	OauthClientID     string `envconfig:"default=directorId"`
	OauthClientSecret string `envconfig:"default=directorSecret"`
	OauthScope        string `envconfig:"default=runtime:read runtime:write"`
}

type FakeClient

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

func NewFakeClient

func NewFakeClient() *FakeClient

func (*FakeClient) GetLabel

func (f *FakeClient) GetLabel(accountID, runtimeID, key string) (string, bool)

func (*FakeClient) SetLabel

func (f *FakeClient) SetLabel(accountID, runtimeID, key, value string) error

type GraphQLClient

type GraphQLClient interface {
	Run(ctx context.Context, req *machineGraph.Request, resp interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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