files

package
v0.0.0-...-226c3a4 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(New, NewOptions)

Functions

func GetFileAbsPath

func GetFileAbsPath(base, fileName string) (fileAbsPath string, err error)

Types

type FileManager

type FileManager interface {
	SetBase(base string)
	GetBase() string
	CreateFile(fileName string, bytes []byte) error
	CreateDirectory(fileName string) error
	FetchFile(fileName string) ([]byte, error)
	IsFileExists(fileName string) (bool, error)
	IsDirectoryExists(fileName string) (bool, error)
}

func New

func New(o *Options) (FileManager, error)

New for file library

type LocalFileManager

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

func (*LocalFileManager) CreateDirectory

func (m *LocalFileManager) CreateDirectory(fileName string) (err error)

func (*LocalFileManager) CreateFile

func (m *LocalFileManager) CreateFile(fileName string, bytes []byte) (err error)

func (*LocalFileManager) FetchFile

func (m *LocalFileManager) FetchFile(fileName string) ([]byte, error)

func (*LocalFileManager) GetBase

func (m *LocalFileManager) GetBase() string

func (*LocalFileManager) IsDirectoryExists

func (m *LocalFileManager) IsDirectoryExists(fileName string) (bool, error)

func (*LocalFileManager) IsFileExists

func (m *LocalFileManager) IsFileExists(filePath string) (bool, error)

func (*LocalFileManager) SetBase

func (m *LocalFileManager) SetBase(base string)

type Options

type Options struct {
	Type string `yaml:"type"`
	Base string `yaml:"base"`
}

Options is log configuration struct

func NewOptions

func NewOptions(v *viper.Viper, logger *zap.Logger) (*Options, error)

Jump to

Keyboard shortcuts

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