server

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileBase

type FileBase struct {
	// contains filtered or unexported fields
}

FileBase implements Provider interface using file system.

func NewFileBase

func NewFileBase(root string) *FileBase

NewFileBase ...

func (*FileBase) Create

func (fb *FileBase) Create(ID string) (io.WriteCloser, error)

Create return WriteCloser interface for write the contents.

func (*FileBase) Open

func (fb *FileBase) Open(ID string) (io.ReadCloser, error)

Open return ReadCloser interface for read the contents.

func (*FileBase) WithFs

func (fb *FileBase) WithFs(fs afero.Fs) *FileBase

type MgoFS

type MgoFS struct {
	// contains filtered or unexported fields
}

MgoFS ...

func NewMgoFS

func NewMgoFS(uri string, db string, prefix string) *MgoFS

NewMgoFS ...

func (*MgoFS) Create

func (m *MgoFS) Create(ID string) (io.WriteCloser, error)

Create ...

func (*MgoFS) Open

func (m *MgoFS) Open(ID string) (io.ReadCloser, error)

Open ...

type Provider

type Provider interface {
	Create(ID string) (io.WriteCloser, error)
	Open(ID string) (io.ReadCloser, error)
}

Provider interface defines Blob Provider's Methods.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server structure implements BlobServiceServer.

func NewServer

func NewServer(provider Provider) *Server

NewServer return Server object.

func (*Server) Get

func (s *Server) Get(req *blob.GetRequest, stream blob.BlobService_GetServer) error

Get handles get request from client.

func (*Server) Push

func (s *Server) Push(stream blob.BlobService_PushServer) error

Push handles push call from client.

Jump to

Keyboard shortcuts

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