Help us shape the future of Go! Take the 2026 Go Developer Survey

cloudapi

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEncodingResourcesQuery = errors.New("failed to encode resources query")
View Source
var ErrFetchingResources = errors.New("failed to fetch resources")
View Source
var ErrInitializingResourcesRequest = errors.New("failed to initialize resources request")
View Source
var ErrInvalidURL = errors.New("invalid URL")
View Source
var ErrMissingToken = errors.New("no API token provided")

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(config ClientConfig) (*Client, error)

func NewClientFromEnv

func NewClientFromEnv() (*Client, error)

func (*Client) Do added in v0.21.0

func (c *Client) Do(req *http.Request) (*http.Response, error)

func (*Client) Resources

func (c *Client) Resources(ctx context.Context, orgID string, params ResourcesParameters) (resources []ResourceObject, e error)

type ClientConfig

type ClientConfig struct {
	HTTPClient *http.Client
	URL        string
	Token      string
	Version    string
}

type CollectionDocumentRes

type CollectionDocumentRes struct {
	Data  []ResourceObject `json:"data"`
	Links Links
}
type Links struct {
	Next string `json:"next"`
}

type ResourceAttributes

type ResourceAttributes struct {
	Namespace    string                 `json:"namespace"`
	ResourceType string                 `json:"resource_type"`
	ResourceID   string                 `json:"resource_id"`
	State        map[string]interface{} `json:"state"`
	Tags         map[string]interface{} `json:"tags"`
}

type ResourceObject

type ResourceObject struct {
	ID         string             `json:"id,omitempty"`
	Type       string             `json:"type"`
	Attributes ResourceAttributes `json:"attributes,omitempty"`
}

type ResourcesParameters

type ResourcesParameters struct {
	EnvironmentID []string `url:"environment_id,omitempty"`
	ResourceType  []string `url:"resource_type,omitempty"`
	ResourceID    []string `url:"resource_id,omitempty"`
	NativeID      []string `url:"native_id,omitempty"`
	ID            []string `url:"id,omitempty"`
	Platform      []string `url:"platform,omitempty"`
	Name          []string `url:"name,omitempty"`
	Location      []string `url:"location,omitempty"`
}

Jump to

Keyboard shortcuts

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