cli

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 9 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 WithDeleteDependents added in v0.1.6

func WithDeleteDependents(deleteDependents bool) Option

func WithHeader

func WithHeader(key, val string) Option

type PortClient

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

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, deleteDependents bool) error

func (*PortClient) DeleteStaleEntities added in v0.1.6

func (c *PortClient) DeleteStaleEntities(ctx context.Context, stateKey string, existingEntitiesSet map[string]interface{}) error

func (*PortClient) GetEntityIdentifierKey added in v0.1.6

func (c *PortClient) GetEntityIdentifierKey(portEntity *port.Entity) string

func (*PortClient) ReadEntity

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

func (*PortClient) SearchEntities added in v0.1.6

func (c *PortClient) SearchEntities(ctx context.Context, body port.SearchBody) ([]port.Entity, error)

Jump to

Keyboard shortcuts

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