pdc

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInternal indicates the item could not be processed.
	ErrInternal = errors.New("internal error")
	// ErrInvalidCredentials indicates the auth token is incorrect
	ErrInvalidCredentials = errors.New("invalid credentials")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	SignSSHKey(ctx context.Context, key []byte) (*SigningResponse, error)
}

Client is a PDC API client

func NewClient

func NewClient(cfg *Config, logger log.Logger) (Client, error)

NewClient returns a new Client

type Config

type Config struct {
	Token           string
	HostedGrafanaID string
	URL             *url.URL
	RetryMax        int

	// The version of pdc-agent thats running, defined by goreleaser during the build process.
	Version string

	// The PDC api endpoint used to sign public keys.
	// It is not a constant only to make it easier to override the endpoint in local development.
	SignPublicKeyEndpoint string

	// Used for local development.
	// Contains headers that are included in each http request send to the pdc api.
	DevHeaders map[string]string

	// Used for local development.
	// DevNetwork is the network that the agent will connect to.
	DevNetwork string
}

Config describes all properties that can be configured for the PDC package

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(fs *flag.FlagSet)

type SigningResponse

type SigningResponse struct {
	Certificate ssh.Certificate
	KnownHosts  []byte
}

SigningResponse is the response received from a SSH key signing request

func (*SigningResponse) UnmarshalJSON

func (sr *SigningResponse) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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