remoteks

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

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

View Source
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) Descriptor() ([]byte, []int)

func (*ByteMsg) GetData

func (m *ByteMsg) GetData() []byte

func (*ByteMsg) ProtoMessage

func (*ByteMsg) ProtoMessage()

func (*ByteMsg) Reset

func (m *ByteMsg) Reset()

func (*ByteMsg) String

func (m *ByteMsg) String() string

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

ListFiles returns all known identifiers in the storage backend.

func (*GRPCStorage) Remove

Remove deletes the data associated with the provided identifier.

func (*GRPCStorage) Set

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.

func (*RemoteStore) Set

func (s *RemoteStore) Set(fileName string, data []byte) error

Set stores the data using the provided fileName

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) Descriptor() ([]byte, []int)

func (*SetMsg) GetData

func (m *SetMsg) GetData() []byte

func (*SetMsg) GetFileName

func (m *SetMsg) GetFileName() string

func (*SetMsg) ProtoMessage

func (*SetMsg) ProtoMessage()

func (*SetMsg) Reset

func (m *SetMsg) Reset()

func (*SetMsg) String

func (m *SetMsg) String() string

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 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

Jump to

Keyboard shortcuts

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