Documentation ¶
Overview ¶
Package service defines types for the storage service.
Index ¶
- Variables
- type Config
- type Host
- type Service
- func (s *Service) AddToGRPCServer(gs *grpc.Server)
- func (s *Service) Config() interface{}
- func (s *Service) Desc() string
- func (s *Service) Expose() interface{}
- func (s *Service) ID() string
- func (s *Service) Name() string
- func (s *Service) Needs() map[string]struct{}
- func (s *Service) Plug(services map[string]interface{}) error
- func (s *Service) Run(ctx context.Context, running, stopping func()) error
- func (s *Service) SetConfig(config interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrFileNameMissing is returned when no file name was given. ErrFileNameMissing = errors.New("the first chunk should have the filename") // ErrUploadSessionNotFound is returned when no upload session could be found. ErrUploadSessionNotFound = errors.New("the given session was not found") // ErrInvalidUploadSession is returned when the session id could not be parsed. ErrInvalidUploadSession = errors.New("the given session could not be parsed") )
View Source
var ( // ErrNotHost is returned when the connected service is not a host. ErrNotHost = errors.New("connected service is not a host") // available. ErrUnavailable = errors.New("the service is not available") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Host is the name of the host service. Host string `toml:"host" comment:"The name of the host service."` // Path to the local storage folder. LocalStorage string `toml:"local_storage" comment:"The path to the local storage."` // DbPath is the path to the database used for file hashes and permissions. DbPath string `toml:"db_path" comment:"The path to the database used for the state and the chain."` // UploadTimeout is the time after which an upload session will be reset (and the partial file deleted). UploadTimeout string `toml:"upload_timeout" comment:"The time after which an upload session will be reset (and the partial file deleted)"` }
Config contains configuration options for the Storage service.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the Storage service.
func (*Service) AddToGRPCServer ¶
AddToGRPCServer adds the service to a gRPC server.
func (*Service) Config ¶
func (s *Service) Config() interface{}
Config returns the current service configuration or creates one with good default values.
func (*Service) Expose ¶
func (s *Service) Expose() interface{}
Expose exposes the storage service to other services. It is currently not exposed.
Click to show internal directories.
Click to hide internal directories.