apiclient

package
v0.9.17 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAPIKey = errors.New("Invalid API key")

Functions

func ReportCLIError

func ReportCLIError(ctx *config.RunContext, cliErr error) error

Types

type APIClient

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

func (*APIClient) AddAuthHeaders

func (c *APIClient) AddAuthHeaders(req *http.Request)

func (*APIClient) AddDefaultHeaders

func (c *APIClient) AddDefaultHeaders(req *http.Request)

type APIError

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

func (*APIError) Error

func (e *APIError) Error() string

type APIErrorResponse

type APIErrorResponse struct {
	Error string `json:"error"`
}

type AddRunResponse added in v0.9.16

type AddRunResponse struct {
	RunID    string `json:"id"`
	ShareURL string `json:"shareUrl"`
}

type CreateAPIKeyResponse

type CreateAPIKeyResponse struct {
	APIKey string `json:"apiKey"`
	Error  string `json:"error"`
}

type DashboardAPIClient

type DashboardAPIClient struct {
	APIClient
	// contains filtered or unexported fields
}

func NewDashboardAPIClient

func NewDashboardAPIClient(ctx *config.RunContext) *DashboardAPIClient

func (*DashboardAPIClient) AddRun

func (c *DashboardAPIClient) AddRun(ctx *config.RunContext, projectContexts []*config.ProjectContext, out output.Root) (AddRunResponse, error)

func (*DashboardAPIClient) CreateAPIKey

func (c *DashboardAPIClient) CreateAPIKey(name string, email string) (CreateAPIKeyResponse, error)

type GraphQLQuery

type GraphQLQuery struct {
	Query     string                 `json:"query"`
	Variables map[string]interface{} `json:"variables"`
}

type PriceQueryKey

type PriceQueryKey struct {
	Resource      *schema.Resource
	CostComponent *schema.CostComponent
}

type PriceQueryResult

type PriceQueryResult struct {
	PriceQueryKey
	Result gjson.Result
}

type PricingAPIClient

type PricingAPIClient struct {
	APIClient
	Currency       string
	EventsDisabled bool
}

func NewPricingAPIClient

func NewPricingAPIClient(ctx *config.RunContext) *PricingAPIClient

func (*PricingAPIClient) AddEvent added in v0.9.5

func (c *PricingAPIClient) AddEvent(name string, env map[string]interface{}) error

func (*PricingAPIClient) RunQueries

func (c *PricingAPIClient) RunQueries(r *schema.Resource) ([]PriceQueryResult, error)

Jump to

Keyboard shortcuts

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