common

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound added in v0.3.1

func IsNotFound(err error) bool

func IsUnknown added in v0.3.1

func IsUnknown(err error) bool

func NotFoundError added in v0.3.1

func NotFoundError(message string) error

func Wrap added in v0.3.1

func Wrap(err1 error, err2 error) error

Types

type Event added in v0.3.1

type Event string
const (
	ListNamespaces      Event = "ListNamespaces"
	ListServices        Event = "ListServices"
	GetOperation        Event = "GetOperation"
	DiscoverInstances   Event = "DiscoverInstances"
	CreateHttpNamespace Event = "CreateHttpNamespace"
	CreateService       Event = "CreateService"
	RegisterInstance    Event = "RegisterInstance"
	DeregisterInstance  Event = "DeregisterInstance"
)

type Logger

type Logger interface {
	Info(msg string, keysAndValues ...interface{})
	Debug(msg string, keysAndValues ...interface{})
	Error(err error, msg string, keysAndValues ...interface{})
}

func NewLogger

func NewLogger(name string, names ...string) Logger

func NewLoggerWithLogr

func NewLoggerWithLogr(l logr.Logger) Logger

type RateLimiter added in v0.3.1

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

func NewDefaultRateLimiter added in v0.3.1

func NewDefaultRateLimiter() RateLimiter

NewDefaultRateLimiter returns the rate limiters with the default limits for the AWS CloudMap's API calls

func (RateLimiter) Wait added in v0.3.1

func (r RateLimiter) Wait(ctx context.Context, event Event) error

Wait blocks until limit permits an event to happen. It returns an error if the Context is canceled, or the expected wait time exceeds the Context's Deadline.

Jump to

Keyboard shortcuts

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