Documentation ¶
Overview ¶
This package simplifies file IO and handles the file path when using JSON or MSGPACK. When using Output the path will be the URI like /api/my/file/uri/{unique_id} When using Input the path will be the relative file system path my/relative/file/path/{unique_id}
Index ¶
- func IsFileInfo(maybeFile map[string]interface{}) bool
- func NameWithExt(fileName string, ext string) string
- type IO
- func (me *IO) ContentType() string
- func (me *IO) MarshalBSON() ([]byte, error)
- func (me *IO) MarshalJSON() ([]byte, error)
- func (me *IO) MarshalMsgpack() ([]byte, error)
- func (me *IO) Meta() Meta
- func (me *IO) Name() string
- func (me *IO) NameWithExt(ext string) string
- func (me *IO) Path() string
- func (me *IO) PathName() string
- func (me *IO) SetBaseDir(baseDir string)
- func (me *IO) SetRef(ref string)
- func (me *IO) SetSize(s int64)
- func (me *IO) Size() int64
- func (me *IO) String() string
- func (me *IO) ToMap() map[string]interface{}
- func (me *IO) UnmarshalBSON(raw []byte) error
- func (me *IO) UnmarshalJSON(b []byte) error
- func (me *IO) UnmarshalMsgpack(b []byte) error
- func (me *IO) Update(name, contentType string)
- type InMemoryFileInfo
- type MapIO
- func (me MapIO) Get(path string) interface{}
- func (me MapIO) GetAllDataAndFiles(baseDir string) (dat map[string]interface{}, files []string)
- func (me MapIO) GetAllFileInfos(baseDir string) []*IO
- func (me MapIO) GetFileInfo(baseDir, path string) *IO
- func (me MapIO) MakeFileInfos(baseDir string)
- func (me MapIO) MergeWith(v map[string]interface{})
- type Meta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsFileInfo ¶
func NameWithExt ¶
Types ¶
type IO ¶
type IO struct { Hash string // contains filtered or unexported fields }
func (*IO) ContentType ¶
func (*IO) MarshalBSON ¶
func (*IO) MarshalJSON ¶
func (*IO) MarshalMsgpack ¶
func (*IO) NameWithExt ¶
func (*IO) SetBaseDir ¶
func (*IO) UnmarshalBSON ¶
func (*IO) UnmarshalJSON ¶
func (*IO) UnmarshalMsgpack ¶
type InMemoryFileInfo ¶
func (InMemoryFileInfo) IsDir ¶
func (fi InMemoryFileInfo) IsDir() bool
func (InMemoryFileInfo) ModTime ¶
func (fi InMemoryFileInfo) ModTime() time.Time
func (InMemoryFileInfo) Mode ¶
func (fi InMemoryFileInfo) Mode() os.FileMode
func (InMemoryFileInfo) Name ¶
func (fi InMemoryFileInfo) Name() string
func (InMemoryFileInfo) Size ¶
func (fi InMemoryFileInfo) Size() int64
func (InMemoryFileInfo) Sys ¶
func (fi InMemoryFileInfo) Sys() interface{}
type MapIO ¶
type MapIO map[string]interface{}
func (MapIO) GetAllDataAndFiles ¶
func (MapIO) GetAllFileInfos ¶
func (MapIO) GetFileInfo ¶
GetFileInfo retrieves the value by a path like key.key2.key3
func (MapIO) MakeFileInfos ¶
MakeFileInfos makes sure all file map patterns are replaced by actual Info's
Click to show internal directories.
Click to hide internal directories.