Documentation ¶
Index ¶
- type Config
- type ContentType
- type File
- type GrpcService
- func (s *GrpcService) GetObject(c context.Context, params *s420con.ObjectPath) (*s420con.GetResponse, error)
- func (s *GrpcService) GetObjectFromBucket(c context.Context, params *s420con.ObjectFromBucket) (*s420con.GetResponse, error)
- func (s *GrpcService) SaveNewObject(c context.Context, params *s420con.NewObjectParams) (*s420con.SaveResponse, error)
- func (s *GrpcService) SaveObjectInBucket(c context.Context, params *s420con.NewObjectInBucket) (*s420con.SaveResponse, error)
- type HumanClient
- type ObjectOptions
- type Public
- type SaveResponse
- type Security
- type Service
- type Storage
- type StorageSystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Storage Storage `yaml:"storage"` Service Service `yaml:"service"` Public Public `yaml:"public"` Security Security `yaml:"security"` }
Config is the struct to config your s420
func NewConfigFromFile ¶
NewConfigFromFile returns a new config struct
type File ¶
type File struct { Path string Name string Size int64 MD5 string Type ContentType Thumbnail []byte }
File describes a file saved on your storage system
type GrpcService ¶
type GrpcService struct {
Store StorageSystem
}
GrpcService is a s420 service
func (*GrpcService) GetObject ¶
func (s *GrpcService) GetObject(c context.Context, params *s420con.ObjectPath) (*s420con.GetResponse, error)
GetObject implements a s420 server
func (*GrpcService) GetObjectFromBucket ¶
func (s *GrpcService) GetObjectFromBucket(c context.Context, params *s420con.ObjectFromBucket) (*s420con.GetResponse, error)
GetObjectFromBucket implements a s420 server
func (*GrpcService) SaveNewObject ¶
func (s *GrpcService) SaveNewObject(c context.Context, params *s420con.NewObjectParams) (*s420con.SaveResponse, error)
SaveNewObject implements a s420 server
func (*GrpcService) SaveObjectInBucket ¶
func (s *GrpcService) SaveObjectInBucket(c context.Context, params *s420con.NewObjectInBucket) (*s420con.SaveResponse, error)
SaveObjectInBucket implements a s420 server
type HumanClient ¶
type HumanClient struct {
// contains filtered or unexported fields
}
HumanClient describe the public client to get access to storage
func NewHumanClient ¶
func NewHumanClient(store StorageSystem, c Public, r *gin.Engine) *HumanClient
NewHumanClient returns a new public client
func (*HumanClient) Run ¶
func (client *HumanClient) Run()
Run launch the http instance of the client
type Security ¶
type Security struct { ServerCertPath string `yaml:"server_cert_path"` ServerKeyPath string `yaml:"server_key_path"` }
Security describe the certificates path
type Service ¶
type Service struct {
Port int64 `yaml:"port"`
}
Service define the grpc service configuration
type Storage ¶
type Storage struct { Backend string `yaml:"backend"` Endpoint string `yaml:"endpoint"` AccessKey string `yaml:"access_key"` SecretAccessKey string `yaml:"secret_access_key"` UseSSL bool `yaml:"use_ssl"` }
Storage define the config to storage system (default: minio)
type StorageSystem ¶
type StorageSystem interface { SaveObjectInBucket(bucket string, fileName string, data []byte, options *ObjectOptions) (*SaveResponse, error) GetObjectFromBucket(bucket string, path string) ([]byte, ContentType, error) // data, content-type, error SaveNewObject(path string, data []byte, options *ObjectOptions) (*SaveResponse, error) GetObject(path string) ([]byte, ContentType, error) // data, content-type, error }
StorageSystem represent the store struct to dialog with minio or any store type