filesessions

package
v4.0.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Directory is a directory with files
	Directory string
}

Config is a file uploader configuration

func (*Config) CheckAndSetDefaults

func (s *Config) CheckAndSetDefaults() error

CheckAndSetDefaults checks and sets default values of file handler config

type Handler

type Handler struct {
	// Config is a file sessions config
	Config
	// Entry is a file entry
	*log.Entry
}

Handler uploads and downloads sessions archives by reading and writing files to directory, useful for NFS setups and tests

func NewHandler

func NewHandler(cfg Config) (*Handler, error)

NewHandler returns new file sessions handler

func (*Handler) Close

func (l *Handler) Close() error

Closer releases connection and resources associated with log if any

func (*Handler) Download

func (l *Handler) Download(ctx context.Context, sessionID session.ID, writer io.WriterAt) error

Download downloads session recording from storage, in case of file handler reads the file from local directory

func (*Handler) Upload

func (l *Handler) Upload(ctx context.Context, sessionID session.ID, reader io.Reader) (string, error)

Upload uploads session recording to file storage, in case of file handler, writes the file to local directory

Jump to

Keyboard shortcuts

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