datastore

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAlbumInBlacklist added in v0.3.0

func IsAlbumInBlacklist(album string) bool

func IsPictureInBlacklist added in v0.3.0

func IsPictureInBlacklist(pic string) bool

func RemoveContents added in v0.2.1

func RemoveContents(dir string) error

func ScanPath

func ScanPath(path string, g_config *Config.GalleryConfiguration) (map[string]*Node, error)

Types

type Album

type Album struct {
	Id         string    `json:"id"`
	Name       string    `json:"name"`
	ModTime    time.Time `json:"mod_time"`
	Parent     string    `json:"parent"`
	ProfileIMG *Picture  `json:"profile_image"`
	Images     []Picture `json:"images"`
	Key        string    `json:"key"`
}

type DS

type DS interface {
	Close()
	Initialize()
	DeleteAll()
	Get(id string) (interface{}, error)
	Query(field string, val interface{}, limit int) (interface{}, error)
	Edit(obj interface{}) error
	Delete(obj interface{}) error
	GetAll() (interface{}, error)
	Save(obj interface{}) error
}

type DataStore

type DataStore struct {
	// contains filtered or unexported fields
}
var Cache *DataStore

func (*DataStore) Close

func (d *DataStore) Close()

func (DataStore) DoesTableExist

func (d DataStore) DoesTableExist(table string) bool

func (*DataStore) Load

func (d *DataStore) Load()

func (*DataStore) RegisterData

func (d *DataStore) RegisterData(name string, factory DS)

func (*DataStore) RestDB added in v0.2.1

func (d *DataStore) RestDB()

func (DataStore) Tables

func (d DataStore) Tables(table string) DS

type Directory

type Directory struct {
	Album    Album        `json:"album"`
	Children []*Directory `json:"children"`
}

type Exif

type Exif struct {
	FStop        float64   `json:"f_stop"`
	FocalLength  float64   `json:"focal_length"`
	ShutterSpeed string    `json:"shutter_speed"`
	ISO          string    `json:"iso"`
	Dimension    string    `json:"dimension"`
	Camera       string    `json:"camera"`
	LensModel    string    `json: lens_model`
	DateTaken    time.Time `json: date_taken`
}

type FileInfo

type FileInfo struct {
	Name    string      `json:"name"`
	Size    int64       `json:"size"`
	Mode    os.FileMode `json:"mode"`
	ModTime time.Time   `json:"mod_time"`
	IsDir   bool        `json:"is_dir"`
}

FileInfo is a struct created from os.FileInfo interface for serialization.

type Instagram added in v0.3.1

type Instagram struct {
	GalleryPath string
	// contains filtered or unexported fields
}
var IG *Instagram

func (*Instagram) Connect added in v0.3.1

func (i *Instagram) Connect(username, password string) error

func (*Instagram) GetAllPosts added in v0.3.1

func (i *Instagram) GetAllPosts() ([]goinsta.Item, error)

func (*Instagram) GetPost added in v0.3.1

func (i *Instagram) GetPost(id string) (goinsta.Item, error)

func (*Instagram) SavePost added in v0.3.1

func (i *Instagram) SavePost(original goinsta.Item) error

func (*Instagram) SetUpAlbum added in v0.3.1

func (i *Instagram) SetUpAlbum()

func (*Instagram) SyncFrom added in v0.3.1

func (i *Instagram) SyncFrom() error

func (*Instagram) UploadPhoto added in v0.3.1

func (i *Instagram) UploadPhoto(path, caption string) error

type Node

type Node struct {
	FullPath string   `json:"path"`
	Info     FileInfo `json:"info"`
	Children []*Node  `json:"children"`
	Parent   *Node    `json:"-"`
}

Node represents a node in a directory tree.

func NewTree

func NewTree(path string) (result *Node, err error)

type Picture

type Picture struct {
	Id         string `json:"id"`
	Name       string `json:"name"`
	Caption    string `json:"caption"`
	Path       string `json:"path"`
	FormatTime string `json:"format_time"`
	Album      string `json:"album"`
	Exif       Exif   `json:"exif"`
	PostedToIG bool   `json:"posted_to_IG"`
}

func (*Picture) CreateExif

func (u *Picture) CreateExif()

Jump to

Keyboard shortcuts

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