Documentation
¶
Overview ¶
Package storage provides an encrypted key value store and an RPC service for remote unlocking to prevent secrets being stored on remote nonvolatile storage.
Index ¶
- Variables
- func DB() *badger.DB
- func InitFlags(cmd *cobra.Command)
- func RegisterUnlockServiceServer(s grpc.ServiceRegistrar, srv UnlockServiceServer)
- func Run()
- func Shutdown() (err error)
- func Txn(tx func(txn *badger.Txn) error, update bool) (err error)
- func Update(fn func(txn *badger.Txn) error) error
- func View(fn func(txn *badger.Txn) error) error
- func WhenIsLocked() chan bool
- func WhenIsUnlocked() chan bool
- func WhenReady() chan bool
- func WhenStartFailed() chan error
- type Key
- type Service
- type UnimplementedUnlockServiceServer
- type UnlockRequest
- type UnlockResponse
- func (*UnlockResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UnlockResponse) GetMessage() string
- func (x *UnlockResponse) GetSuccess() bool
- func (*UnlockResponse) ProtoMessage()
- func (x *UnlockResponse) ProtoReflect() protoreflect.Message
- func (x *UnlockResponse) Reset()
- func (x *UnlockResponse) String() string
- type UnlockServiceClient
- type UnlockServiceServer
- type UnsafeUnlockServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_unlock_proto protoreflect.FileDescriptor
var UnlockService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "rpc.UnlockService", HandlerType: (*UnlockServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Unlock", Handler: _UnlockService_Unlock_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "unlock.proto", }
UnlockService_ServiceDesc is the grpc.ServiceDesc for UnlockService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterUnlockServiceServer ¶
func RegisterUnlockServiceServer(s grpc.ServiceRegistrar, srv UnlockServiceServer)
func WhenIsLocked ¶
func WhenIsLocked() chan bool
func WhenIsUnlocked ¶
func WhenIsUnlocked() chan bool
func WhenStartFailed ¶
func WhenStartFailed() chan error
Types ¶
type Service ¶
type Service struct{}
func NewUnlockService ¶
func NewUnlockService() *Service
func (*Service) Unlock ¶
func (s *Service) Unlock(ctx context.Context, req *UnlockRequest) (res *UnlockResponse, err error)
type UnimplementedUnlockServiceServer ¶
type UnimplementedUnlockServiceServer struct { }
UnimplementedUnlockServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedUnlockServiceServer) Unlock ¶
func (UnimplementedUnlockServiceServer) Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error)
type UnlockRequest ¶
type UnlockRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // contains filtered or unexported fields }
func (*UnlockRequest) Descriptor
deprecated
func (*UnlockRequest) Descriptor() ([]byte, []int)
Deprecated: Use UnlockRequest.ProtoReflect.Descriptor instead.
func (*UnlockRequest) GetKey ¶
func (x *UnlockRequest) GetKey() string
func (*UnlockRequest) ProtoMessage ¶
func (*UnlockRequest) ProtoMessage()
func (*UnlockRequest) ProtoReflect ¶
func (x *UnlockRequest) ProtoReflect() protoreflect.Message
func (*UnlockRequest) Reset ¶
func (x *UnlockRequest) Reset()
func (*UnlockRequest) String ¶
func (x *UnlockRequest) String() string
type UnlockResponse ¶
type UnlockResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Message *string `protobuf:"bytes,2,opt,name=message,proto3,oneof" json:"message,omitempty"` // contains filtered or unexported fields }
func (*UnlockResponse) Descriptor
deprecated
func (*UnlockResponse) Descriptor() ([]byte, []int)
Deprecated: Use UnlockResponse.ProtoReflect.Descriptor instead.
func (*UnlockResponse) GetMessage ¶
func (x *UnlockResponse) GetMessage() string
func (*UnlockResponse) GetSuccess ¶
func (x *UnlockResponse) GetSuccess() bool
func (*UnlockResponse) ProtoMessage ¶
func (*UnlockResponse) ProtoMessage()
func (*UnlockResponse) ProtoReflect ¶
func (x *UnlockResponse) ProtoReflect() protoreflect.Message
func (*UnlockResponse) Reset ¶
func (x *UnlockResponse) Reset()
func (*UnlockResponse) String ¶
func (x *UnlockResponse) String() string
type UnlockServiceClient ¶
type UnlockServiceClient interface {
Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error)
}
UnlockServiceClient is the client API for UnlockService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewUnlockServiceClient ¶
func NewUnlockServiceClient(cc grpc.ClientConnInterface) UnlockServiceClient
type UnlockServiceServer ¶
type UnlockServiceServer interface { Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error) // contains filtered or unexported methods }
UnlockServiceServer is the server API for UnlockService service. All implementations must embed UnimplementedUnlockServiceServer for forward compatibility
type UnsafeUnlockServiceServer ¶
type UnsafeUnlockServiceServer interface {
// contains filtered or unexported methods
}
UnsafeUnlockServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UnlockServiceServer will result in compilation errors.