services

package
v1.14.10 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 66 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHost = "127.0.0.1"
	DefaultPort = 8200

	DefaultVaultToken = "root"
)
View Source
const (
	DefaultProxyName = "default~proxy"
)

Variables

This section is empty.

Functions

func AdvanceBindPort added in v1.2.15

func AdvanceBindPort(p *uint32) uint32

func AllocateGlooPort

func AllocateGlooPort() int32

func NextBindPort

func NextBindPort() uint32

func RunPetstore added in v0.18.3

func RunPetstore(ctx context.Context, port int) error

Types

type ConsulFactory

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

func NewConsulFactory

func NewConsulFactory() (*ConsulFactory, error)

func (*ConsulFactory) Clean

func (cf *ConsulFactory) Clean() error

func (*ConsulFactory) MustConsulInstance added in v1.14.0

func (cf *ConsulFactory) MustConsulInstance() *ConsulInstance

func (*ConsulFactory) NewConsulInstance

func (cf *ConsulFactory) NewConsulInstance() (*ConsulInstance, error)

type ConsulInstance

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

func (*ConsulInstance) AddConfig

func (i *ConsulInstance) AddConfig(svcId, content string) error

func (*ConsulInstance) AddConfigFromStruct

func (i *ConsulInstance) AddConfigFromStruct(svcId string, cfg interface{}) error

func (*ConsulInstance) Binary

func (i *ConsulInstance) Binary() string

func (*ConsulInstance) Clean

func (i *ConsulInstance) Clean()

Clean stops the ConsulInstance

func (*ConsulInstance) Client added in v1.14.7

func (i *ConsulInstance) Client() *api.Client

Client returns the Consul API client, constructing one if necessary

func (*ConsulInstance) Put added in v1.14.7

func (i *ConsulInstance) Put(key string, value []byte) error

Put wraps the Consul KV Put API call

func (*ConsulInstance) RegisterLiveService added in v1.13.0

func (i *ConsulInstance) RegisterLiveService(svcName, svcId, address string, tags []string, port uint32) error

RegisterLiveService While it may be tempting to just reload all config using `consul reload` or marshalling new json and sending SIGHUP to the process (per https://www.consul.io/commands/reload), it is preferable to live update using the consul APIs as this is a more realistic flow and doesn't fire our watches too actively (which can both make debugging hard and hide bugs)

func (*ConsulInstance) RegisterService added in v0.17.4

func (i *ConsulInstance) RegisterService(svcName, svcId, address string, tags []string, port uint32) error

func (*ConsulInstance) ReloadConfig

func (i *ConsulInstance) ReloadConfig() error

func (*ConsulInstance) Run

func (i *ConsulInstance) Run(ctx context.Context) error

Run starts the ConsulInstance When the provided context is Done, the ConsulInstance is cleaned up

func (*ConsulInstance) Silence

func (i *ConsulInstance) Silence()

type DockerOptions added in v1.5.0

type DockerOptions struct {
	// Extra volume arguments
	Volumes []string
	// Extra env arguments.
	// see https://docs.docker.com/engine/reference/run/#env-environment-variables for more info
	Env []string
}

Extra options for running in docker

type EnvoyBootstrapBuilder added in v1.6.0

type EnvoyBootstrapBuilder interface {
	Build(ei *EnvoyInstance) string
}

type EnvoyFactory

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

func NewEnvoyFactory

func NewEnvoyFactory() (*EnvoyFactory, error)

func (*EnvoyFactory) Clean

func (ef *EnvoyFactory) Clean() error

func (*EnvoyFactory) EnvoyPath

func (ef *EnvoyFactory) EnvoyPath() string

func (*EnvoyFactory) MustEnvoyInstance added in v1.2.15

func (ef *EnvoyFactory) MustEnvoyInstance() *EnvoyInstance

func (*EnvoyFactory) NewEnvoyInstance

func (ef *EnvoyFactory) NewEnvoyInstance() (*EnvoyInstance, error)

type EnvoyInstance

type EnvoyInstance struct {
	AccessLogAddr string
	AccessLogPort uint32
	RatelimitAddr string
	RatelimitPort uint32
	ID            string
	Role          string

	UseDocker   bool
	GlooAddr    string // address for gloo and services
	Port        uint32
	RestXdsPort uint32
	AdminPort   uint32

	// Envoy API Version to use, default to V3
	ApiVersion string

	DockerOptions
	// contains filtered or unexported fields
}

func (*EnvoyInstance) Binary

func (ei *EnvoyInstance) Binary() string

func (*EnvoyInstance) Clean

func (ei *EnvoyInstance) Clean()

func (*EnvoyInstance) ConfigDump added in v1.14.0

func (ei *EnvoyInstance) ConfigDump() (string, error)

func (*EnvoyInstance) DisablePanicMode added in v1.6.0

func (ei *EnvoyInstance) DisablePanicMode() error

func (*EnvoyInstance) EnablePanicMode added in v1.6.0

func (ei *EnvoyInstance) EnablePanicMode() error

func (*EnvoyInstance) LocalAddr

func (ei *EnvoyInstance) LocalAddr() string

func (*EnvoyInstance) Logs

func (ei *EnvoyInstance) Logs() (string, error)

func (*EnvoyInstance) RunWith added in v1.2.15

func (ei *EnvoyInstance) RunWith(eic EnvoyInstanceConfig) error

func (*EnvoyInstance) RunWithConfigFile added in v1.6.0

func (ei *EnvoyInstance) RunWithConfigFile(port int, configFile string) error

func (*EnvoyInstance) RunWithRole

func (ei *EnvoyInstance) RunWithRole(role string, port int) error

func (*EnvoyInstance) RunWithRoleAndRestXds added in v1.6.7

func (ei *EnvoyInstance) RunWithRoleAndRestXds(role string, glooPort, restXdsPort int) error

func (*EnvoyInstance) Statistics added in v1.14.0

func (ei *EnvoyInstance) Statistics() (string, error)

type EnvoyInstanceConfig added in v1.2.15

type EnvoyInstanceConfig interface {
	Role() string
	Port() uint32
	RestXdsPort() uint32

	Context() context.Context
}

type NatsStreamingFactory

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

func NewNatsStreamingFactory

func NewNatsStreamingFactory() (*NatsStreamingFactory, error)

func (*NatsStreamingFactory) Clean

func (gf *NatsStreamingFactory) Clean() error

func (*NatsStreamingFactory) NewNatsStreamingInstance

func (gf *NatsStreamingFactory) NewNatsStreamingInstance() (*NatsStreamingInstance, error)

type NatsStreamingInstance

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

func (*NatsStreamingInstance) Clean

func (nsi *NatsStreamingInstance) Clean() error

func (*NatsStreamingInstance) ClusterId

func (nsi *NatsStreamingInstance) ClusterId() string

func (*NatsStreamingInstance) NatsPort

func (nsi *NatsStreamingInstance) NatsPort() uint32

func (*NatsStreamingInstance) Run

func (nsi *NatsStreamingInstance) Run() error

type RunOptions

type RunOptions struct {
	NsToWrite      string
	NsToWatch      []string
	WhatToRun      What
	GlooPort       int32
	ValidationPort int32
	RestXdsPort    int32
	Settings       *gloov1.Settings
	KubeClient     kubernetes.Interface
}

type Runner

type Runner struct {
	Sourcepath    string
	ComponentName string
}

type SafeBuffer added in v1.12.21

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

SafeBuffer is a goroutine safe bytes.Buffer

func (*SafeBuffer) String added in v1.12.21

func (s *SafeBuffer) String() string

String returns the contents of the unread portion of the buffer as a string. If the Buffer is a nil pointer, it returns "<nil>".

func (*SafeBuffer) Write added in v1.12.21

func (s *SafeBuffer) Write(p []byte) (n int, err error)

Write appends the contents of p to the buffer, growing the buffer as needed. It returns the number of bytes written.

type TestClients

type TestClients struct {
	GatewayClient        gatewayv1.GatewayClient
	HttpGatewayClient    gatewayv1.MatchableHttpGatewayClient
	TcpGatewayClient     gatewayv1.MatchableTcpGatewayClient
	VirtualServiceClient gatewayv1.VirtualServiceClient
	ProxyClient          gloov1.ProxyClient
	UpstreamClient       gloov1.UpstreamClient
	SecretClient         gloov1.SecretClient
	ArtifactClient       gloov1.ArtifactClient
	ServiceClient        skkube.ServiceClient
	GlooPort             int
	RestXdsPort          int
}

TestClients represents the set of ResourceClients available for tests

func RunGlooGatewayUdsFds

func RunGlooGatewayUdsFds(ctx context.Context, runOptions *RunOptions) TestClients

func (TestClients) DeleteSnapshot added in v1.9.25

func (c TestClients) DeleteSnapshot(ctx context.Context, snapshot *gloosnapshot.ApiSnapshot) error

DeleteSnapshot deletes all resources in the ApiSnapshot from the cache

func (TestClients) WriteSnapshot added in v1.9.25

func (c TestClients) WriteSnapshot(ctx context.Context, snapshot *gloosnapshot.ApiSnapshot) error

WriteSnapshot writes all resources in the ApiSnapshot to the cache

type VaultFactory

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

func NewVaultFactory

func NewVaultFactory() (*VaultFactory, error)

NewVaultFactory returns a VaultFactory TODO (sam-heilbron): TODO This factory supports a number of mechanisms to run vault (binary path as env var, lookup vault, docker) TODO We should just decide what pattern(s) we want to support and simplify this service to match

func (*VaultFactory) Clean

func (vf *VaultFactory) Clean() error

func (*VaultFactory) MustVaultInstance added in v1.14.0

func (vf *VaultFactory) MustVaultInstance() *VaultInstance

func (*VaultFactory) NewVaultInstance

func (vf *VaultFactory) NewVaultInstance() (*VaultInstance, error)

type VaultInstance

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

func (*VaultInstance) Address added in v1.9.25

func (i *VaultInstance) Address() string

func (*VaultInstance) Binary

func (i *VaultInstance) Binary() string

func (*VaultInstance) Clean

func (i *VaultInstance) Clean()

func (*VaultInstance) EnableAWSAuthMethod added in v1.14.0

func (i *VaultInstance) EnableAWSAuthMethod(settings *v1.Settings_VaultSecrets, awsAuthRole string) error

func (*VaultInstance) EnableSecretEngine added in v1.9.25

func (i *VaultInstance) EnableSecretEngine(secretEngine string) error

func (*VaultInstance) Exec

func (i *VaultInstance) Exec(args ...string) (string, error)

func (*VaultInstance) Host added in v1.14.0

func (i *VaultInstance) Host() string

func (*VaultInstance) Run

func (i *VaultInstance) Run(ctx context.Context) error

func (*VaultInstance) Token

func (i *VaultInstance) Token() string

func (*VaultInstance) WriteSecret added in v1.14.0

func (i *VaultInstance) WriteSecret(secret *v1.Secret) error

WriteSecret persists a Secret in Vault

type What

type What struct {
	DisableGateway bool
	DisableUds     bool
	DisableFds     bool
}

Jump to

Keyboard shortcuts

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