client

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: BSD-3-Clause Imports: 19 Imported by: 6

Documentation

Index

Constants

View Source
const (
	FileURIScheme string = "file:"
)

Variables

This section is empty.

Functions

func GetVideoHeight

func GetVideoHeight(source string) string

func InitKey

func InitKey() []byte

func SaveConfig added in v0.3.2

func SaveConfig(name string, config Config) error

func Tag added in v0.3.2

func Tag(tie *TieClient, info TagInfo) error

Types

type AddReply

type AddReply = *api.AddReply

type AssociatedOptions added in v0.3.2

type AssociatedOptions = api.AssociatedOptions

type AssociatedReply added in v0.1.8

type AssociatedReply = *api.AssociatedReply

type BatchReply

type BatchReply = *api.BatchReply

type Config

type Config struct {
	Username         string
	Password         string
	Namespace        string
	Collection       string
	Webservice       string
	UIDService       string
	DefaultFileHosts []string
	Import           ImportConfig
	FileHosts        map[string]string
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig() Config

func LoadConfig added in v0.3.2

func LoadConfig(configName string) (Config, error)

func ReadConfig

func ReadConfig(configName string) Config

Deprecated - use LoadConfig instead

func TestingConfig

func TestingConfig() Config

type DeleteReply

type DeleteReply = *api.DeleteReply

type DirUID added in v0.3.4

type DirUID string

func (DirUID) String added in v0.3.4

func (d DirUID) String() string

type GetOptions added in v0.3.2

type GetOptions = api.GetOptions

type GetReply

type GetReply = *api.GetReply

type ImportConfig added in v0.3.2

type ImportConfig struct {
	ImageCollection    string
	VideoCollection    string
	AudioCollection    string
	DocumentCollection string
	GeneralCollection  string
}

type ObjectManager added in v0.1.5

type ObjectManager[T any] struct {
	Limit  int
	Offset int
	// contains filtered or unexported fields
}

func NewObjectManager added in v0.1.5

func NewObjectManager[T any](client *TieClient, collectionUid string) ObjectManager[T]

func (*ObjectManager[T]) Add added in v0.1.6

func (om *ObjectManager[T]) Add(object any) error

func (*ObjectManager[T]) Associated added in v0.1.8

func (om *ObjectManager[T]) Associated(property string) (objects []T, err error)

func (*ObjectManager[T]) Delete added in v0.1.7

func (om *ObjectManager[T]) Delete(object any) error

func (*ObjectManager[T]) Get added in v0.1.8

func (om *ObjectManager[T]) Get(uid string) (T, error)

func (*ObjectManager[T]) GetAll added in v0.1.5

func (om *ObjectManager[T]) GetAll() ([]T, error)

func (*ObjectManager[T]) ResultToMap added in v0.1.8

func (om *ObjectManager[T]) ResultToMap(result tiedb.TripleSet) (objects map[string]T)

func (*ObjectManager[T]) ResultToObject added in v0.1.8

func (om *ObjectManager[T]) ResultToObject(uid string, result tiedb.TripleSet) (obj T)

func (*ObjectManager[T]) ResultToSlice added in v0.1.8

func (om *ObjectManager[T]) ResultToSlice(result tiedb.TripleSet) (objects []T)

func (*ObjectManager[T]) Upsert added in v0.1.6

func (om *ObjectManager[T]) Upsert(object any) error

type TagInfo added in v0.3.2

type TagInfo struct {
	Hash          string
	File          string
	Size          int
	MediaType     string
	TieType       TieType
	Tags          []string
	Directory     DirUID
	DirectoryType TieType
}

type TagOptions

type TagOptions struct {
	AddOriginalPath               bool
	PutlibForceGenerateThumbnails bool
}

type TieCategory added in v0.3.2

type TieCategory int

type TieClient

type TieClient struct {
	Config Config
	// contains filtered or unexported fields
}

func NewTieClient

func NewTieClient(config Config) (client *TieClient)

func (*TieClient) Add

func (tc *TieClient) Add(key, value1, value2 string, handler func(reply AddReply))

Add a triple to the collection

func (*TieClient) Associated added in v0.1.8

func (tc *TieClient) Associated(key string, handler func(reply AssociatedReply))

Get a TripleSet with all triples that are associated with 'key'

func (*TieClient) AssociatedWith added in v0.3.2

func (tc *TieClient) AssociatedWith(key string, o AssociatedOptions, handler func(reply AssociatedReply))

Get a TripleSet with all triples that are associated with 'key'

func (*TieClient) Batch

func (tc *TieClient) Batch(batch *api.Batch, handler func(reply BatchReply))

Run a batch - make new Batch with NewBatch

func (*TieClient) CollectionInfo

func (tc *TieClient) CollectionInfo() api.CollectionInfo

func (*TieClient) CreateTieRootDir added in v0.3.4

func (tie *TieClient) CreateTieRootDir() error

func (*TieClient) Delete

func (tc *TieClient) Delete(key, value1, value2 string, handler func(reply DeleteReply))

Delete a triple from the collection

func (*TieClient) DirUIDFromPath added in v0.3.4

func (tie *TieClient) DirUIDFromPath(path string) (DirUID, error)

func (*TieClient) Exists added in v0.1.6

func (tc *TieClient) Exists(key string) bool

Check if the key exists

func (*TieClient) Get

func (tc *TieClient) Get(key string, o GetOptions, handler func(reply GetReply))

Get a TripleSet from a key with options

func (*TieClient) ImportDir added in v0.3.2

func (tie *TieClient) ImportDir(dir string, host string, parentDir DirUID, dirType TieType, tags []string) error

func (*TieClient) ImportFile added in v0.3.2

func (tie *TieClient) ImportFile(file string, host string, tags []string, directory DirUID, dirType TieType) error

func (*TieClient) MkTieDir added in v0.3.4

func (tie *TieClient) MkTieDir(path string) (DirUID, error)

func (*TieClient) MkTieDirAll added in v0.3.5

func (tie *TieClient) MkTieDirAll(path string) (DirUID, error)

func (*TieClient) NewBatch

func (tc *TieClient) NewBatch() *api.Batch

Make a new Batch - run with Batch function

func (*TieClient) NewUpdate added in v0.1.1

func (tc *TieClient) NewUpdate(key, value1, value2, newValue2 string) api.Update

func (*TieClient) PrintState

func (tc *TieClient) PrintState()

func (*TieClient) ReadTieDir added in v0.3.4

func (tie *TieClient) ReadTieDir(path string) (DirUID, error)

func (*TieClient) SimpleGet added in v0.3.2

func (tc *TieClient) SimpleGet(key string, handler func(reply GetReply))

Get a TripleSet from a key

func (*TieClient) Sync added in v0.3.0

func (tc *TieClient) Sync() error

Wait until all changes has been committed to the collection

func (*TieClient) Update

func (tc *TieClient) Update(update api.Update, handler func(reply UpdateReply))

Update a triple in the collection

type TieProperty added in v0.3.2

type TieProperty int
const (
	TieUid          TieProperty = iota // tie-uid
	TieDirectory                       // directory
	TieIsDir                           // is-dir
	TieFilename                        // filename
	TieFilesize                        // filesize
	TieName                            // name
	TieMediaType                       // media-type
	TieFileHost                        // filehost
	TieTag                             // tag
	TiePath                            // path
	TieParent                          // parent
	TieTags                            // tags
	TieTagDate                         // tag-date
	TieCollection                      // collection
	TieTypeProperty                    // tie-type
	TieAll                             // all
)

func (TieProperty) String added in v0.3.2

func (i TieProperty) String() string

type TieType added in v0.3.2

type TieType int
const (
	TieUnknownFile     TieType = iota // unknown-file
	TieImageFile                      // image-file
	TieAudioFile                      // audio-file
	TieVideoFile                      // video-file
	TieDocumentFile                   // document-file
	TieArchiveFile                    // archive-file
	TieImageDir                       // image-dir
	TieAudioDir                       // audio-dir
	TieVideoDir                       // video-dir
	TieDocumentDir                    // document-dir
	TieImageArchive                   // image-archive
	TieVideoArchive                   // video-archive
	TieDocumentArchive                // document-archive
)

func GetTieType added in v0.3.2

func GetTieType(file io.Reader) (TieType, error)

func GetTieTypeFromPath added in v0.3.2

func GetTieTypeFromPath(path string) (TieType, error)

func (TieType) String added in v0.3.2

func (i TieType) String() string

type Uid added in v0.3.4

type Uid struct {
	Uid string
}

type Update added in v0.1.6

type Update = api.Update

type UpdateReply

type UpdateReply = *api.UpdateReply

Jump to

Keyboard shortcuts

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