Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DateFilter ¶
type DateFilter struct {
// contains filtered or unexported fields
}
DateFilter used to filter documents by date. Must be initialized with NewDateFilter function.
Value formats:
- "<date>" : after date.
- "<date>" : before date.
- "=<date>" : equal (exact date).
- "<date>~<date>" : between dates.
Date format is "2006-01-02 15:04:05".
type FileFilter ¶
type FileFilter struct {
// contains filtered or unexported fields
}
FileFilter used to filter metadata by file flag.
func NewFileFilter ¶
func NewFileFilter(value string) (*FileFilter, error)
NewFileFilter creates new FileFilter instance.
value must be 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False..
Returns ErrInvalidFilterValue if value is invalid.
type Filter ¶
Filter used to filter metadata.
func NewDateFilter ¶
NewDateFilter creates new DateFilter instance.
value format:
- "<date>" : after date.
- "<date>" : before date.
- "=<date>" : equal (exact date).
- "<date>~<date>" : between dates.
Date format is "2006-01-02 15:04:05".
Returns ErrInvalidFilterValue if value is invalid.
func QuerryFilter ¶
QuerryFilter creates new Filter instance based on given key and value.
key:
- "owner" : filter by owner id.
- "file" : filter by file status.
- "name" : filter by name.
- "mime" : filter by mime type.
- "public" : filter by public status.
- "created" : filter by creation date.
- "grant" : filter by user login.
- "id" : filter by document id.
value format depends on filter type.
Returns ErrUnknownFilter if key is unknown.
type GrantFilter ¶
type GrantFilter struct {
// contains filtered or unexported fields
}
GrantFilter used to filter metadata by grant.
func NewGrantFilter ¶
func NewGrantFilter(login string) (*GrantFilter, error)
NewGrantFilter creates new GrantFilter instance.
login must be login of user with grant access.
Returns ErrInvalidFilterValue if login is empty or invalid.
type IDFilter ¶
type IDFilter struct {
// contains filtered or unexported fields
}
IDFilter used to filter metadata by id.
func NewIDFilter ¶
NewIDFilter creates new IDFilter instance.
id must be valid uuid.
Returns ErrInvalidFilterValue if id is invalid.
type MimeFilter ¶
type MimeFilter struct {
// contains filtered or unexported fields
}
MimeFilter used to filter metadata by mime type.
func NewMimeFilter ¶
func NewMimeFilter(value string) (*MimeFilter, error)
NewMimeFilter creates new MimeFilter instance.
value must be mime type to filter by.
Returns ErrInvalidFilterValue if value is invalid.
type NameFilter ¶
type NameFilter struct {
// contains filtered or unexported fields
}
NameFilter used to filter metadata by name.
func NewNameFilter ¶
func NewNameFilter(value string) (*NameFilter, error)
NewNameFilter creates a new NameFilter instance with the given name value. The value can have a wildcard prefix or suffix, indicated by '*', to match the start or end of a name, respectively.
type OwnerFilter ¶
type OwnerFilter struct {
// contains filtered or unexported fields
}
OwnerFilter used to filter metadata by owner id.
func NewOwnerFilter ¶
func NewOwnerFilter(value string) (*OwnerFilter, error)
NewOwnerFilter creates a new OwnerFilter instance with the given owner ID value. The value should be a valid UUID string. If the value is invalid, it returns ErrInvalidFilterValue.
type PublicFilter ¶
type PublicFilter struct {
// contains filtered or unexported fields
}
PublicFilter used to filter metadata by public flag.
func NewPublicFilter ¶
func NewPublicFilter(isPublic string) (*PublicFilter, error)
NewPublicFilter creates new PublicFilter instance.
value must be 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False.
Returns ErrInvalidFilterValue if value is invalid.