canary

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package canary is a generated GoMock package.

Index

Constants

View Source
const CanaryKind = "EncryptionCanary"

Variables

This section is empty.

Functions

func AsEncryptionStore

func AsEncryptionStore(svc Service) encryption.CanaryStore

AsEncryptionStore wraps a canary Service as an encryption.CanaryStore, converting domain.Status returns to errors.

func InitEncryption

func InitEncryption(ctx context.Context, db *gorm.DB, log logrus.FieldLogger) error

InitEncryption wires the canary store, service, and adapter, then registers everything with the global encryption manager. No-op if encryption is not initialized.

Types

type MockService

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

MockService is a mock of Service interface.

func NewMockService

func NewMockService(ctrl *gomock.Controller) *MockService

NewMockService creates a new mock instance.

func (*MockService) EXPECT

func (m *MockService) EXPECT() *MockServiceMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockService) Get

func (m *MockService) Get(ctx context.Context, strategy, keyID string) (*encryption.Canary, domain.Status)

Get mocks base method.

func (*MockService) GetAll

GetAll mocks base method.

func (*MockService) PrepareForRetirement

func (m *MockService) PrepareForRetirement(ctx context.Context, strategy, keyID string) domain.Status

PrepareForRetirement mocks base method.

func (*MockService) Save

func (m *MockService) Save(ctx context.Context, canary *encryption.Canary) domain.Status

Save mocks base method.

type MockServiceMockRecorder

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

MockServiceMockRecorder is the mock recorder for MockService.

func (*MockServiceMockRecorder) Get

func (mr *MockServiceMockRecorder) Get(ctx, strategy, keyID any) *gomock.Call

Get indicates an expected call of Get.

func (*MockServiceMockRecorder) GetAll

func (mr *MockServiceMockRecorder) GetAll(ctx any) *gomock.Call

GetAll indicates an expected call of GetAll.

func (*MockServiceMockRecorder) PrepareForRetirement

func (mr *MockServiceMockRecorder) PrepareForRetirement(ctx, strategy, keyID any) *gomock.Call

PrepareForRetirement indicates an expected call of PrepareForRetirement.

func (*MockServiceMockRecorder) Save

func (mr *MockServiceMockRecorder) Save(ctx, canary any) *gomock.Call

Save indicates an expected call of Save.

type Service

type Service interface {
	Get(ctx context.Context, strategy, keyID string) (*encryption.Canary, domain.Status)
	Save(ctx context.Context, canary *encryption.Canary) domain.Status
	GetAll(ctx context.Context) ([]encryption.Canary, domain.Status)
	PrepareForRetirement(ctx context.Context, strategy, keyID string) domain.Status
}

Service is the entry point for canary operations.

func WrapWithTracing

func WrapWithTracing(inner Service) Service

WrapWithTracing returns a Service that wraps inner with tracing spans, or nil if inner is nil.

type ServiceHandler

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

func NewServiceHandler

func NewServiceHandler(store canarystore.Store) *ServiceHandler

func (*ServiceHandler) Get

func (h *ServiceHandler) Get(ctx context.Context, strategy, keyID string) (*encryption.Canary, domain.Status)

func (*ServiceHandler) GetAll

func (*ServiceHandler) PrepareForRetirement

func (h *ServiceHandler) PrepareForRetirement(ctx context.Context, strategy, keyID string) domain.Status

func (*ServiceHandler) Save

type TracedService

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

TracedService wraps a Service implementation with OpenTelemetry tracing.

func (*TracedService) Get

func (_d *TracedService) Get(ctx context.Context, strategy string, keyID string) (cp1 *encryption.Canary, s1 domain.Status)

func (*TracedService) GetAll

func (_d *TracedService) GetAll(ctx context.Context) (ca1 []encryption.Canary, s1 domain.Status)

func (*TracedService) PrepareForRetirement

func (_d *TracedService) PrepareForRetirement(ctx context.Context, strategy string, keyID string) (s1 domain.Status)

func (*TracedService) Save

func (_d *TracedService) Save(ctx context.Context, canary *encryption.Canary) (s1 domain.Status)

Jump to

Keyboard shortcuts

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