util

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultSocketPath = "/tmp/spire-registration.sock"
)

Variables

This section is empty.

Functions

func Dial added in v0.12.0

func Dial(socketPath string) (*grpc.ClientConn, error)

func NewRegistrationClient

func NewRegistrationClient(socketPath string) (registration.RegistrationClient, error)

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 added in v0.12.0

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

func AdaptCommand added in v0.12.0

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 added in v0.12.0

func (a *Adapter) Help() string

func (*Adapter) Run added in v0.12.0

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

func (*Adapter) Synopsis added in v0.12.0

func (a *Adapter) Synopsis() string

type Command added in v0.12.0

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 added in v0.12.0

type ServerClient interface {
	Release()
	NewAgentClient() agent.AgentClient
	NewBundleClient() bundle.BundleClient
	NewEntryClient() entry.EntryClient
	NewSVIDClient() svid.SVIDClient
}

func NewServerClient added in v0.12.0

func NewServerClient(socketPath string) (ServerClient, error)

Jump to

Keyboard shortcuts

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