Documentation
¶
Overview ¶
Package canary is a generated GoMock package.
Index ¶
- Constants
- func AsEncryptionStore(svc Service) encryption.CanaryStore
- func InitEncryption(ctx context.Context, db *gorm.DB, log logrus.FieldLogger) error
- type MockService
- func (m *MockService) EXPECT() *MockServiceMockRecorder
- func (m *MockService) Get(ctx context.Context, strategy, keyID string) (*encryption.Canary, domain.Status)
- func (m *MockService) GetAll(ctx context.Context) ([]encryption.Canary, domain.Status)
- func (m *MockService) PrepareForRetirement(ctx context.Context, strategy, keyID string) domain.Status
- func (m *MockService) Save(ctx context.Context, canary *encryption.Canary) domain.Status
- type MockServiceMockRecorder
- func (mr *MockServiceMockRecorder) Get(ctx, strategy, keyID any) *gomock.Call
- func (mr *MockServiceMockRecorder) GetAll(ctx any) *gomock.Call
- func (mr *MockServiceMockRecorder) PrepareForRetirement(ctx, strategy, keyID any) *gomock.Call
- func (mr *MockServiceMockRecorder) Save(ctx, canary any) *gomock.Call
- type Service
- type ServiceHandler
- func (h *ServiceHandler) Get(ctx context.Context, strategy, keyID string) (*encryption.Canary, domain.Status)
- func (h *ServiceHandler) GetAll(ctx context.Context) ([]encryption.Canary, domain.Status)
- func (h *ServiceHandler) PrepareForRetirement(ctx context.Context, strategy, keyID string) domain.Status
- func (h *ServiceHandler) Save(ctx context.Context, canary *encryption.Canary) domain.Status
- type TracedService
- func (_d *TracedService) Get(ctx context.Context, strategy string, keyID string) (cp1 *encryption.Canary, s1 domain.Status)
- func (_d *TracedService) GetAll(ctx context.Context) (ca1 []encryption.Canary, s1 domain.Status)
- func (_d *TracedService) PrepareForRetirement(ctx context.Context, strategy string, keyID string) (s1 domain.Status)
- func (_d *TracedService) Save(ctx context.Context, canary *encryption.Canary) (s1 domain.Status)
Constants ¶
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 ¶
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 ¶
func (m *MockService) GetAll(ctx context.Context) ([]encryption.Canary, domain.Status)
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.
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 ¶
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 (h *ServiceHandler) GetAll(ctx context.Context) ([]encryption.Canary, domain.Status)
func (*ServiceHandler) PrepareForRetirement ¶
func (*ServiceHandler) Save ¶
func (h *ServiceHandler) Save(ctx context.Context, canary *encryption.Canary) domain.Status
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 (*TracedService) Save ¶
func (_d *TracedService) Save(ctx context.Context, canary *encryption.Canary) (s1 domain.Status)