Documentation ¶
Overview ¶
Package remoteks is a generated protocol buffer package.
It is generated from these files:
keystore.proto
It has these top-level messages:
SetMsg FileNameMsg ByteMsg StringListMsg
Index ¶
- Constants
- func RegisterStoreServer(s *grpc.Server, srv StoreServer)
- type ByteMsg
- type FileNameMsg
- type GRPCStorage
- func (s *GRPCStorage) Get(ctx context.Context, fn *FileNameMsg) (*ByteMsg, error)
- func (s *GRPCStorage) ListFiles(ctx context.Context, _ *google_protobuf.Empty) (*StringListMsg, error)
- func (s *GRPCStorage) Remove(ctx context.Context, fn *FileNameMsg) (*google_protobuf.Empty, error)
- func (s *GRPCStorage) Set(ctx context.Context, msg *SetMsg) (*google_protobuf.Empty, error)
- type RemoteStore
- type SetMsg
- type StoreClient
- type StoreServer
- type StringListMsg
Constants ¶
const DefaultTimeout = time.Second * 30
DefaultTimeout is the time a request will block waiting for a response from the server if no other timeout is configured.
Variables ¶
This section is empty.
Functions ¶
func RegisterStoreServer ¶
func RegisterStoreServer(s *grpc.Server, srv StoreServer)
Types ¶
type ByteMsg ¶
type ByteMsg struct {
Data []byte `protobuf:"bytes,1,opt,name=Data,proto3" json:"Data,omitempty"`
}
func (*ByteMsg) Descriptor ¶
func (*ByteMsg) ProtoMessage ¶
func (*ByteMsg) ProtoMessage()
type FileNameMsg ¶
type FileNameMsg struct {
FileName string `protobuf:"bytes,1,opt,name=FileName" json:"FileName,omitempty"`
}
func (*FileNameMsg) Descriptor ¶
func (*FileNameMsg) Descriptor() ([]byte, []int)
func (*FileNameMsg) GetFileName ¶
func (m *FileNameMsg) GetFileName() string
func (*FileNameMsg) ProtoMessage ¶
func (*FileNameMsg) ProtoMessage()
func (*FileNameMsg) Reset ¶
func (m *FileNameMsg) Reset()
func (*FileNameMsg) String ¶
func (m *FileNameMsg) String() string
type GRPCStorage ¶
type GRPCStorage struct {
// contains filtered or unexported fields
}
GRPCStorage is an implementer of the GRPC storage server. It passes through the requested operations to an underlying trustmanager.Storage instance, translating between the Go and GRPC interfaces.
func NewGRPCStorage ¶
func NewGRPCStorage(backend trustmanager.Storage) *GRPCStorage
NewGRPCStorage instantiates a new GRPC storage server using the provided backend.
func (*GRPCStorage) Get ¶
func (s *GRPCStorage) Get(ctx context.Context, fn *FileNameMsg) (*ByteMsg, error)
Get returns the data associated with the provided identifier.
func (*GRPCStorage) ListFiles ¶
func (s *GRPCStorage) ListFiles(ctx context.Context, _ *google_protobuf.Empty) (*StringListMsg, error)
ListFiles returns all known identifiers in the storage backend.
func (*GRPCStorage) Remove ¶
func (s *GRPCStorage) Remove(ctx context.Context, fn *FileNameMsg) (*google_protobuf.Empty, error)
Remove deletes the data associated with the provided identifier.
func (*GRPCStorage) Set ¶
func (s *GRPCStorage) Set(ctx context.Context, msg *SetMsg) (*google_protobuf.Empty, error)
Set writes the provided data under the given identifier.
type RemoteStore ¶
type RemoteStore struct {
// contains filtered or unexported fields
}
RemoteStore is a wrapper around the GRPC storage client, translating between the Go and GRPC APIs.
func NewRemoteStore ¶
func NewRemoteStore(server string, tlsConfig *tls.Config, timeout time.Duration) (*RemoteStore, error)
NewRemoteStore instantiates a RemoteStore.
func (*RemoteStore) Get ¶
func (s *RemoteStore) Get(fileName string) ([]byte, error)
Get returns the file content found at fileName relative to the base directory of the file store. Paths are expected to be cleaned server side.
func (*RemoteStore) ListFiles ¶
func (s *RemoteStore) ListFiles() []string
ListFiles returns a list of paths relative to the base directory of the filestore. Any of these paths must be retrievable via the Storage.Get method.
func (*RemoteStore) Location ¶
func (s *RemoteStore) Location() string
Location returns a human readable indication of where the storage is located.
func (*RemoteStore) Remove ¶
func (s *RemoteStore) Remove(fileName string) error
Remove deletes a file from the store relative to the store's base directory. Paths are expected to be cleaned server side.
type SetMsg ¶
type SetMsg struct { FileName string `protobuf:"bytes,1,opt,name=FileName" json:"FileName,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"` }
func (*SetMsg) Descriptor ¶
func (*SetMsg) GetFileName ¶
func (*SetMsg) ProtoMessage ¶
func (*SetMsg) ProtoMessage()
type StoreClient ¶
type StoreClient interface { Set(ctx context.Context, in *SetMsg, opts ...grpc.CallOption) (*google_protobuf.Empty, error) Remove(ctx context.Context, in *FileNameMsg, opts ...grpc.CallOption) (*google_protobuf.Empty, error) Get(ctx context.Context, in *FileNameMsg, opts ...grpc.CallOption) (*ByteMsg, error) ListFiles(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*StringListMsg, error) }
func NewStoreClient ¶
func NewStoreClient(cc *grpc.ClientConn) StoreClient
type StoreServer ¶
type StoreServer interface { Set(context.Context, *SetMsg) (*google_protobuf.Empty, error) Remove(context.Context, *FileNameMsg) (*google_protobuf.Empty, error) Get(context.Context, *FileNameMsg) (*ByteMsg, error) ListFiles(context.Context, *google_protobuf.Empty) (*StringListMsg, error) }
type StringListMsg ¶
type StringListMsg struct {
FileNames []string `protobuf:"bytes,1,rep,name=FileNames" json:"FileNames,omitempty"`
}
func (*StringListMsg) Descriptor ¶
func (*StringListMsg) Descriptor() ([]byte, []int)
func (*StringListMsg) GetFileNames ¶
func (m *StringListMsg) GetFileNames() []string
func (*StringListMsg) ProtoMessage ¶
func (*StringListMsg) ProtoMessage()
func (*StringListMsg) Reset ¶
func (m *StringListMsg) Reset()
func (*StringListMsg) String ¶
func (m *StringListMsg) String() string