client

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewControllerClient

func NewControllerClient(config ControllerConfig) controller.Interface

NewControllerClient return a new Client

Types

type AliasClient

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

AliasClient is a client for manipulating Alias structures in Insprd

func (*AliasClient) Create

func (ac *AliasClient) Create(ctx context.Context, scope, target string, alias *meta.Alias, dryRun bool) (diff.Changelog, error)

Create creates an alias inside the Insprd The scope refers to the parent app of the given alias, represented with a dot separated query such as app1.app2. The parameter "target" refers to where the alias will point to

func (*AliasClient) Delete

func (ac *AliasClient) Delete(ctx context.Context, scope, key string, dryRun bool) (diff.Changelog, error)

Delete deletes a alias inside the Insprd The scope refers to the parent app of the given alias, represented with a dot separated query such as app1.app2. The key is the key of the alias to be deleted.

func (*AliasClient) Get

func (ac *AliasClient) Get(ctx context.Context, scope, key string) (*meta.Alias, error)

Get gets a alias from the Insprd The scope refers to the parent app of the given alias, represented with a dot separated query such as app1.app2. The key is the key of the alias

func (*AliasClient) Update

func (ac *AliasClient) Update(ctx context.Context, scope, target string, alias *meta.Alias, dryRun bool) (diff.Changelog, error)

Update updates a alias inside the Insprd The scope refers to the parent app of the given alias, represented with a dot separated query such as app1.app2. Works similarly to the Create method.

type AppClient

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

AppClient is a client for manipulating dApp structures in Insprd

func (*AppClient) Create

func (ac *AppClient) Create(ctx context.Context, scope string, app *meta.App, dryRun bool) (diff.Changelog, error)

Create creates given dApp in Insprd The scope refers to the parent app where the actual app will be instantiated, represented with a dot separated query such as **app1.app2**.

func (*AppClient) Delete

func (ac *AppClient) Delete(ctx context.Context, scope string, dryRun bool) (diff.Changelog, error)

Delete deletes a dApp that exists in Insprd. The scope refers to the app itself, represented with a dot separated query such as app1.app2

func (*AppClient) Get

func (ac *AppClient) Get(ctx context.Context, scope string) (*meta.App, error)

Get gets information of a dApp that exists in Insprd. The scope refers to the app itself, represented with a dot separated query such as app1.app2

func (*AppClient) Update

func (ac *AppClient) Update(ctx context.Context, scope string, app *meta.App, dryRun bool) (diff.Changelog, error)

Update updates a dApp in Insprd, if it exists. The scope refers to the parent dApp where the actual dApp is instantiated, represented with a dot separated query such as app1.app2

type AuthClient

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

AuthClient is a client for getting auth information from Insprd

func (*AuthClient) GenerateToken

func (ac *AuthClient) GenerateToken(ctx context.Context, payload auth.Payload) (string, error)

GenerateToken sends a request containing a payload so Insprd generates a new auth token based on the payload's info

func (*AuthClient) Init

func (ac *AuthClient) Init(ctx context.Context, key string) (string, error)

Init function for initializing a cluster

type BrokersClient

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

BrokersClient interacts with Brokers on the Insprd

func (*BrokersClient) Create

func (bc *BrokersClient) Create(ctx context.Context, brokerName string, config []byte) error

Create creates a broker into the cluster via insprd

func (*BrokersClient) Get

Get gets a brokers from the Insprd

type ChannelClient

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

ChannelClient is a client for manipulating Channel structures in Insprd

func (*ChannelClient) Create

func (cc *ChannelClient) Create(ctx context.Context, scope string, ch *meta.Channel, dryRun bool) (diff.Changelog, error)

Create creates given channel inside of Insprd The scope refers to the parent app of the given channel, represented with a dot separated query such as app1.app2

func (*ChannelClient) Delete

func (cc *ChannelClient) Delete(ctx context.Context, scope, name string, dryRun bool) (diff.Changelog, error)

Delete deletes a channel inside the Insprd The scope refers to the parent app of the given channel, represented with a dot separated query such as app1.app2. The name is the name of the channel to be deleted

func (*ChannelClient) Get

func (cc *ChannelClient) Get(ctx context.Context, scope, name string) (*meta.Channel, error)

Get gets a channel from Insprd The scope refers to the parent app of the given channel, represented with a dot separated query such as app1.app2. The name is the name of the channel.

func (*ChannelClient) Update

func (cc *ChannelClient) Update(ctx context.Context, scope string, ch *meta.Channel, dryRun bool) (diff.Changelog, error)

Update updates given channel structure, if it exists in Insprd The scope refers to the parent app of the given channel, represented with a dot separated query such as app1.app2

type Client

type Client struct {
	HTTPClient *request.Client
	Config     ControllerConfig
}

Client implements communication with the Insprd

func (*Client) Alias

func (c *Client) Alias() controller.AliasInterface

Alias interacts with alias on the Insprd

func (*Client) Apps

func (c *Client) Apps() controller.AppInterface

Apps interacts with apps on the Insprd

func (*Client) Authorization

func (c *Client) Authorization() controller.AuthorizationInterface

Authorization interacts with Insprd's auth

func (*Client) Brokers

func (c *Client) Brokers() controller.BrokersInterface

Brokers interacts with brokers from the Insprd

func (*Client) Channels

func (c *Client) Channels() controller.ChannelInterface

Channels interacts with channels on the Insprd

func (*Client) Types

func (c *Client) Types() controller.TypeInterface

Types interacts with types on the Insprd

type ControllerConfig

type ControllerConfig struct {
	Auth  request.Authenticator
	Scope string
	URL   string
	Host  string
}

ControllerConfig stores controller configuration for ease of use and posterior verification.

func GetInClusterConfigs

func GetInClusterConfigs() (*ControllerConfig, error)

GetInClusterConfigs retrieves controller configs from current dApp deployment.

type TypeClient

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

TypeClient is a client for manipulating Type structures in Insprd

func (*TypeClient) Create

func (tc *TypeClient) Create(ctx context.Context, scope string, t *meta.Type, dryRun bool) (diff.Changelog, error)

Create creates given Type inside of Insprd The scope refers to the dApp in which the Type will be in, represented with a dot separated query such as app1.app2

func (*TypeClient) Delete

func (tc *TypeClient) Delete(ctx context.Context, scope, name string, dryRun bool) (diff.Changelog, error)

Delete deletes a Type from Insprd, if exists. The scope refers to the dApp in which the Type is in, represented with a dot separated query such as app1.app2. The name is the name of the Type to be deleted

func (*TypeClient) Get

func (tc *TypeClient) Get(ctx context.Context, scope, name string) (*meta.Type, error)

Get gets a Type from Insprd, if it exists. The scope refers to the dApp in which the Type is in, represented with a dot separated query such as app1.app2

func (*TypeClient) Update

func (tc *TypeClient) Update(ctx context.Context, scope string, t *meta.Type, dryRun bool) (diff.Changelog, error)

Update updates given Type in Insprd, if it exists. The scope refers to the dApp in which the Type is in, represented with a dot separated query such asapp1.app2

Jump to

Keyboard shortcuts

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