saver

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const TypeDirect = "direct"
View Source
const TypeHashed = "hashed"
View Source
const TypeNull = "null"

Variables

This section is empty.

Functions

This section is empty.

Types

type Direct

type Direct struct {
	Dir string
}

func NewDirect

func NewDirect(dir string) *Direct

func NewDirectFromMap

func NewDirectFromMap(d map[string]interface{}) (*Direct, error)

func (Direct) GetFilePath

func (s Direct) GetFilePath(path string) string

func (Direct) Save

func (s Direct) Save(path string, data []byte) error

type Hashed

type Hashed struct {
	Dir string
}

func NewHashed

func NewHashed(dir string) *Hashed

func NewHashedFromMap

func NewHashedFromMap(d map[string]interface{}) (*Hashed, error)

func (Hashed) GetFilePath

func (s Hashed) GetFilePath(path string) (string, error)

func (Hashed) Save

func (s Hashed) Save(path string, data []byte) error

type Null

type Null struct {
	Dir string
}

func NewNull

func NewNull() *Null

func NewNullFromMap

func NewNullFromMap(d map[string]interface{}) (*Null, error)

func (Null) Save

func (s Null) Save(path string, data []byte) error

type Saver

type Saver interface {
	Save(path string, data []byte) error
}

func New

func New(t string, d map[string]interface{}) (s Saver, err error)

func NewFromConfig

func NewFromConfig(c interface{}) (s Saver, err error)

Jump to

Keyboard shortcuts

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