api

package
v0.0.0-...-cf45389 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound      = errors.New("not found")
	ErrHashCollision = errors.New("hash collision")
)
View Source
var ConfigToken = &configToken{}

Functions

This section is empty.

Types

type Client

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

func (*Client) AllFiles

func (c *Client) AllFiles() (records.FileIterator, error)

func (*Client) AllTags

func (c *Client) AllTags() (records.TagIterator, error)

func (*Client) CreateFile

func (c *Client) CreateFile(filename string, documentDate time.Time) (uuid.UUID, error)

func (*Client) CreateTags

func (c *Client) CreateTags(names []string) ([]*records.Tag, error)

func (*Client) FileByHandle

func (c *Client) FileByHandle(handleID uuid.UUID) (records.OpenFile, error)

func (*Client) FindFilesWithDate

func (c *Client) FindFilesWithDate(documentDate time.Time) ([]*records.File, error)

func (*Client) FindFilesWithIdPrefix

func (c *Client) FindFilesWithIdPrefix(idPrefix string) ([]*records.File, error)

func (*Client) FindFilesWithTags

func (c *Client) FindFilesWithTags(tagNames []string) ([]*records.File, error)

func (*Client) FindTagByName

func (c *Client) FindTagByName(name string) (*records.Tag, error)

func (*Client) GetFile

func (c *Client) GetFile(id string) (*records.File, error)

func (*Client) GetFileDays

func (c *Client) GetFileDays(year int, month int) ([]int, error)

func (*Client) GetFileMonths

func (c *Client) GetFileMonths(year int) ([]int, error)

func (*Client) GetFileWithDate

func (c *Client) GetFileWithDate(filename string, date time.Time) (*records.File, error)

func (*Client) GetFileYears

func (c *Client) GetFileYears() ([]int, error)

func (*Client) GetTags

func (c *Client) GetTags(names []string) ([]*records.Tag, error)

func (*Client) GetTagsForFile

func (c *Client) GetTagsForFile(id string) (records.TagIterator, error)

func (*Client) OpenFile

func (c *Client) OpenFile(fileID uuid.UUID, mode records.FileMode) (records.OpenFile, error)

func (*Client) ReadFile

func (c *Client) ReadFile(id string) (io.ReadCloser, error)

func (*Client) ReadFileFromOffset

func (c *Client) ReadFileFromOffset(id string, offset uint64) (io.ReadCloser, error)

func (*Client) RemoveFile

func (c *Client) RemoveFile(id string) error

func (*Client) UpdateFileDate

func (c *Client) UpdateFileDate(
	id uuid.UUID,
	newFilename string,
	newDate time.Time,
) error

func (*Client) UpdateFileTags

func (c *Client) UpdateFileTags(
	id uuid.UUID,
	addedTags []string,
	removedTags []string,
) error

type Config

type Config struct {
	StorageRoot string `env:"STORAGE_ROOT" default:"./data"`
}

type Initializer

type Initializer struct {
	Container nacelle.ServiceContainer `service:"container"`
	Logger    nacelle.Logger           `service:"logger"`
}

func NewInitializer

func NewInitializer() *Initializer

func (*Initializer) Init

func (i *Initializer) Init(config nacelle.Config) error

Jump to

Keyboard shortcuts

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