cli

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*PortClient)

func WithClientID

func WithClientID(clientID string) Option

func WithClientSecret

func WithClientSecret(clientSecret string) Option

func WithHeader

func WithHeader(key, val string) Option

type PortClient

type PortClient struct {
	Client       *resty.Client
	ClientID     string
	ClientSecret string
}

func New

func New(baseURL string, opts ...Option) (*PortClient, error)

func (*PortClient) Authenticate

func (c *PortClient) Authenticate(ctx context.Context, clientID, clientSecret string) (string, error)

func (*PortClient) CreateEntity

func (c *PortClient) CreateEntity(ctx context.Context, e *port.Entity, runID string) (*port.Entity, error)

func (*PortClient) DeleteEntity

func (c *PortClient) DeleteEntity(ctx context.Context, id string, blueprint string) error

func (*PortClient) ReadEntity

func (c *PortClient) ReadEntity(ctx context.Context, id string, blueprint string) (*port.Entity, error)

Jump to

Keyboard shortcuts

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