client

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package client contains a client implementation for interfacing with the Phobos server

Index

Constants

View Source
const ServiceDiscoveryPath = "/.well-known/phobos.json"

ServiceDiscoveryPath is the path to the service discovery document.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	AuthSettingsClient       pb.AuthSettingsClient
	OrganizationsClient      pb.OrganizationsClient
	JobsClient               pb.JobsClient
	TeamsClient              pb.TeamsClient
	ProjectsClient           pb.ProjectsClient
	PipelinesClient          pb.PipelinesClient
	PipelineTemplatesClient  pb.PipelineTemplatesClient
	AgentsClient             pb.AgentsClient
	EnvironmentsClient       pb.EnvironmentsClient
	ServiceAccountsClient    pb.ServiceAccountsClient
	LifecycleTemplatesClient pb.LifecycleTemplatesClient
	ReleaseLifecyclesClient  pb.ReleaseLifecyclesClient
	ReleasesClient           pb.ReleasesClient
	PluginRegistryClient     pb.PluginRegistryClient
	VCSProvidersClient       pb.VCSProvidersClient
	VersionClient            pb.VersionClient
	// contains filtered or unexported fields
}

Client is the gateway to interact with the Phobos API.

func New

func New(ctx context.Context, c *Config) (*Client, error)

New returns a new Client struct.

func (*Client) Close

func (c *Client) Close() error

Close closes any underlying connections for this client.

type Config

type Config struct {
	TokenGetter   TokenGetter
	HTTPEndpoint  string
	TLSSkipVerify bool
}

Config is used to configure the client

type GRPCDiscoveryDocument

type GRPCDiscoveryDocument struct {
	Host              string `json:"host"`
	TransportSecurity string `json:"transport_security"`
	Port              string `json:"port"`
}

GRPCDiscoveryDocument represents the contents of the GRPC discovery document.

func NewGRPCDiscoveryDocument

func NewGRPCDiscoveryDocument(ctx context.Context, endpoint string) (*GRPCDiscoveryDocument, error)

NewGRPCDiscoveryDocument returns a new GRPC discovery document. The HTTP get request of the discovery document is done in this function.

func (*GRPCDiscoveryDocument) HasTransportSecurity

func (d *GRPCDiscoveryDocument) HasTransportSecurity() bool

HasTransportSecurity returns true if the GRPC endpoint has transport security enabled.

type TokenGetter

type TokenGetter interface {
	Token(ctx context.Context) (string, error)
}

TokenGetter is an interface for retrieving and renewing a service account token.

Jump to

Keyboard shortcuts

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