client

package
v0.98.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package client provides configuration and convenience methods for making API calls to the holos server.

Package client provides client configuration for the holos cli.

Index

Constants

View Source
const PlatformConfigFile = "platform.config.json"

PlatformConfigFile represents the marshaled json representation of the PlatformConfig DTO used to persist the inputs to the CUE platform code.

View Source
const PlatformMetadataFile = "platform.metadata.json"

PlatformMetadataFile is the platform metadata json file name located in the root of a platform directory. This file is the authoritative source of truth for the PlatformID used in rpc calls to the PlatformService.

Variables

This section is empty.

Functions

func LoadPlatformConfig

func LoadPlatformConfig(ctx context.Context, name string) (*object.PlatformConfig, error)

LoadPlatformConfig loads the PlatformConfig DTO from the platform.config.json file. Useful to provide all values necessary to render cue config without an rpc to the HolosService.

func LoadPlatformMetadata added in v0.90.0

func LoadPlatformMetadata(ctx context.Context, name string) (*platform.Platform, error)

LoadPlatformMetadata loads the platform.metadata.json file from a named path. Used as the authoritative source of truth to obtain a platform id for PlatformService rpc methods.

func SavePlatformConfig

func SavePlatformConfig(ctx context.Context, name string, pc *object.PlatformConfig) (string, error)

SavePlatformConfig writes pc to the platform root directory path identified by name.

Types

type Client

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

Client provides convenience methods for making API calls to the holos server.

func New

func New(cfg *Config) *Client

func (*Client) CreatePlatform

func (*Client) DeletePlatform added in v0.90.0

func (c *Client) DeletePlatform(ctx context.Context, platformID string) (*platform.DeletePlatformResponse, error)

func (*Client) PlatformModel

func (c *Client) PlatformModel(ctx context.Context, platformID string) (*structpb.Struct, error)

PlatformModel gets the platform model from the PlatformService.

func (*Client) Platforms

func (c *Client) Platforms(ctx context.Context, orgID string) ([]*platform.Platform, error)

func (*Client) UpdateForm

func (c *Client) UpdateForm(ctx context.Context, platformID string, form *object.Form) error

func (*Client) UpdatePlatformModel

func (c *Client) UpdatePlatformModel(ctx context.Context, platformID string, model *structpb.Struct) error

type Config

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

func NewConfig

func NewConfig(cfg *holos.Config) *Config

func (*Config) Client

func (c *Config) Client() *holos.ClientConfig

func (*Config) ClientFlagSet

func (c *Config) ClientFlagSet() *flag.FlagSet

func (*Config) Context

func (c *Config) Context() *holos.ClientContext

Context returns the ClientContext useful to get the OrgID and UserID for rpc calls.

func (*Config) Holos

func (c *Config) Holos() *holos.Config

Holos returns the *holos.Config

func (*Config) Token

func (c *Config) Token() *token.Config

func (*Config) TokenFlagSet

func (c *Config) TokenFlagSet() *flag.FlagSet

type PlatformMutation

type PlatformMutation struct {
	Name        string
	DisplayName string
	// contains filtered or unexported fields
}

func (*PlatformMutation) FlagSet

func (pm *PlatformMutation) FlagSet() *flag.FlagSet

Jump to

Keyboard shortcuts

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