api

package
v1.15.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 8 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateStatus added in v1.15.2

func CreateStatus(code codes.Code, msg string) *types.Status

CreateStatus creates a proto Status

func CreateStatusf added in v1.15.2

func CreateStatusf(code codes.Code, format string, a ...any) *types.Status

CreateStatus creates a proto Status

func MakeErr added in v1.15.2

func MakeErr(log logrus.FieldLogger, code codes.Code, msg string, err error) error

MakeErr logs and returns an error composed of: msg, err and code. Errors are treated differently according to its gRPC code.

func MakeStatus added in v1.15.2

func MakeStatus(log logrus.FieldLogger, code codes.Code, msg string, err error) *types.Status

MakeStatus logs and returns a status composed of: msg, err and code. Errors are treated differently according to its gRPC code.

func OK added in v1.15.2

func OK() *types.Status

OK creates a success proto status

Types

type CallCounter

type CallCounter interface {
	AddLabel(name, value string)
}

type Names

type Names struct {
	// RawService is the unmodified service name
	RawService string

	// Service is the shortened service name (e.g. "svid.v1.SVID", "WorkloadAPI")
	Service string

	// Method is the method name (e.g. MintX509SVID)
	Method string

	// MetricKey is the metric key for the method
	MetricKey []string
}

type RateLimiter added in v1.2.0

type RateLimiter interface {
	RateLimit(ctx context.Context, count int) error
}

type RateLimiterFunc added in v1.2.0

type RateLimiterFunc func(ctx context.Context, count int) error

func (RateLimiterFunc) RateLimit added in v1.2.0

func (fn RateLimiterFunc) RateLimit(ctx context.Context, count int) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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