util

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSocketPath    = "/tmp/spire-server/private/api.sock"
	DefaultNamedPipeName = "\\spire-server\\private\\api"
	FormatPEM            = "pem"
	FormatSPIFFE         = "spiffe"
)

Variables

This section is empty.

Functions

func Dial

func Dial(addr net.Addr) (*grpc.ClientConn, error)

func ParseBundle

func ParseBundle(bundleBytes []byte, format, id string) (*api_types.Bundle, error)

func ParseSelector

func ParseSelector(str string) (*api_types.Selector, error)

parseSelector parses a CLI string from type:value into a selector type. Everything to the right of the first ":" is considered a selector value.

func Pluralizer

func Pluralizer(msg string, singular string, plural string, val int) string

Pluralizer concatenates `singular` to `msg` when `val` is one, and `plural` on all other occasions. It is meant to facilitate friendlier CLI output.

Types

type Adapter

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

func AdaptCommand

func AdaptCommand(env *common_cli.Env, cmd Command) *Adapter

AdaptCommand converts a command into one conforming to the Command interface from github.com/mitchellh/cli

func (*Adapter) Help

func (a *Adapter) Help() string

func (*Adapter) Run

func (a *Adapter) Run(args []string) int

func (*Adapter) Synopsis

func (a *Adapter) Synopsis() string

type Command

type Command interface {
	Name() string
	Synopsis() string
	AppendFlags(*flag.FlagSet)
	Run(context.Context, *common_cli.Env, ServerClient) error
}

Command is a common interface for commands in this package. the adapter can adapter this interface to the Command interface from github.com/mitchellh/cli.

type ServerClient

type ServerClient interface {
	Release()
	NewAgentClient() agentv1.AgentClient
	NewBundleClient() bundlev1.BundleClient
	NewEntryClient() entryv1.EntryClient
	NewSVIDClient() svidv1.SVIDClient
	NewTrustDomainClient() trustdomainv1.TrustDomainClient
	NewHealthClient() grpc_health_v1.HealthClient
}

func NewServerClient

func NewServerClient(addr net.Addr) (ServerClient, error)

Jump to

Keyboard shortcuts

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