internal

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsError added in v1.11.0

func AsError[TError error](err error) (TError, bool)

AsError is an inline form of errors.As.

func FromSpaceliftError added in v0.0.3

func FromSpaceliftError(err error) error

FromSpaceliftError wraps the error with a helpful message when encountering a Spacelift error. In this case an unauthorized error.

func IsErrorType added in v1.11.0

func IsErrorType[TError error](err error) bool

IsErrorType reports whether or not the type of any error in err's chain matches the Error type.

Types

type Client

type Client struct {
	Endpoint string
	Token    string
	Version  string
	Commit   string
	// contains filtered or unexported fields
}

Client represents a Spacelift client - in practice a thin wrapper over its (administrative) GraphQL API.

func NewClient added in v0.1.3

func NewClient(endpoint string, token string, requestsPerSecond, maxBurst *int) *Client

NewClient returns a new Spacelift client for the specified endpoint, token and limiter. If limiter is nil, no rate limit is imposed.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, mutationName string, m interface{}, variables map[string]interface{}) error

Mutate runs a GraphQL mutation.

func (*Client) Query

func (c *Client) Query(ctx context.Context, queryName string, q interface{}, variables map[string]interface{}) error

Query runs a GraphQL query.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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