Documentation ¶
Index ¶
- Constants
- Variables
- type Image
- type Info
- type Store
- func (s *Store) Image(hash string) Image
- func (s *Store) ImageAdd(data []byte, flake string) Image
- func (s *Store) ImageData(hash string, preview bool) (Image, []byte)
- func (s *Store) ImageDestroy(hash string)
- func (s *Store) ImageFilePath(hash string) string
- func (s *Store) ImageHashSplit(hash string) string
- func (s *Store) ImageMetadataPath(hash string) string
- func (s *Store) ImageMetadataRead(path string) Image
- func (s *Store) ImagePath(hash string) string
- func (s *Store) ImagePreviewFilePath(hash string) string
- func (s *Store) ImageSnowflake(flake string) Image
- func (s *Store) ImageSnowflakeHash(flake string) string
- func (s *Store) ImageSnowflakePath(flake string) string
- func (s *Store) ImageSnowflakes() []string
- func (s *Store) ImageSource(hash, source string)
- func (s *Store) ImageTagAdd(hash, tag string)
- func (s *Store) ImageTagRemove(hash, tag string)
- func (s *Store) ImageTags(hash string) []string
- func (s *Store) ImageTagsPath(hash string) string
- func (s *Store) Images() []string
- func (s *Store) ImagesDir() string
- func (s *Store) ImagesSnowflakeDir() string
- func (s *Store) SecretAssociate(secret, flake string)
- func (s *Store) SecretDisassociate(secret string)
- func (s *Store) SecretLookup(secret string) User
- func (s *Store) SecretNew() string
- func (s *Store) SecretPath(secret string) string
- func (s *Store) SecretsDir() string
- func (s *Store) Tag(tag string) []string
- func (s *Store) TagCreate(tag string) bool
- func (s *Store) TagDestroy(tag string)
- func (s *Store) TagInfo(tag string) Tag
- func (s *Store) TagMetadataPath(tag string) string
- func (s *Store) TagPath(tag string) string
- func (s *Store) TagType(tag, t string)
- func (s *Store) Tags() []string
- func (s *Store) TagsDir() string
- func (s *Store) User(flake string) User
- func (s *Store) UserAdd(username string, privileged bool) User
- func (s *Store) UserDestroy(flake string)
- func (s *Store) UserImages(flake string) []string
- func (s *Store) UserImagesPath(flake string) string
- func (s *Store) UserMetadata(info User)
- func (s *Store) UserMetadataPath(flake string) string
- func (s *Store) UserPath(flake string) string
- func (s *Store) UserPrivileged(flake string, privileged bool)
- func (s *Store) UserSecretRegen(flake string) string
- func (s *Store) UserUsername(flake, username string)
- func (s *Store) Users() []string
- func (s *Store) UsersDir() string
- type Tag
- type User
Constants ¶
const ( // Artist is the tag type artist. Artist = "artist" // Character is the tag type character. Character = "character" // Copyright is the tag type copyright. Copyright = "copyright" // Generic is the tag type generic. Generic = "generic" // Group is the tag type group. Group = "group" // Meta is the tag type meta. Meta = "meta" )
Variables ¶
var ( // AlreadyExists is returned when store already exists. AlreadyExists = errors.New("store path already exists") )
Functions ¶
This section is empty.
Types ¶
type Image ¶
type Image struct { Snowflake string `json:"snowflake"` Hash string `json:"hash"` Type string `json:"type"` User string `json:"user"` Source string `json:"source"` }
Image represents metadata of an image.
type Info ¶
type Info struct { Revision int `json:"revision"` Compat bool `json:"compat"` Register bool `json:"register"` InitialUser string `json:"initial_user"` PermissionDir os.FileMode `json:"permission_dir"` PermissionFile os.FileMode `json:"permission_file"` }
Info represents system information of a store.
type Store ¶
type Store struct { Path string SingleUser bool Revision int Compat bool Register bool InitialUser string PermissionDir os.FileMode PermissionFile os.FileMode }
Store represents a file store.
func (*Store) ImageDestroy ¶
ImageDestroy destroys an image.
func (*Store) ImageFilePath ¶
ImageFilePath returns path to an image file with specific hash.
func (*Store) ImageHashSplit ¶
ImageHashSplit returns split image hash.
func (*Store) ImageMetadataPath ¶
ImageMetadataPath returns path to an image's metadata file with specific hash.
func (*Store) ImageMetadataRead ¶
ImageMetadataRead reads an image metadata file.
func (*Store) ImagePreviewFilePath ¶
ImagePreviewFilePath returns path to an image preview file with specific hash.
func (*Store) ImageSnowflake ¶
ImageSnowflake returns image that has specific snowflake.
func (*Store) ImageSnowflakeHash ¶
ImageSnowflakeHash returns image hash from snowflake.
func (*Store) ImageSnowflakePath ¶
ImageSnowflakePath returns path to an image with specific snowflake.
func (*Store) ImageSnowflakes ¶
ImageSnowflakes returns all snowflakes.
func (*Store) ImageSource ¶
ImageSource sets image source URL.
func (*Store) ImageTagAdd ¶
ImageTagAdd adds a tag to an image with specific hash.
func (*Store) ImageTagRemove ¶
ImageTagRemove removes a tag from an image with specific hash.
func (*Store) ImageTagsPath ¶
ImageTagsPath returns path to an image's tags with specific hash.
func (*Store) ImagesSnowflakeDir ¶
ImagesSnowflakeDir returns path to image snowflakes.
func (*Store) SecretAssociate ¶
SecretAssociate associates a secret with a user.
func (*Store) SecretDisassociate ¶
SecretDisassociate disassociates a secret.
func (*Store) SecretLookup ¶
SecretLookup looks up an user from a secret.
func (*Store) SecretPath ¶
SecretPath returns path to tokens.
func (*Store) TagDestroy ¶
TagDestroy removes all references from a tag and removes it.
func (*Store) TagMetadataPath ¶
TagMetadataPath returns path to a specific tag's metadata file.
func (*Store) UserDestroy ¶
UserDestroy destroys a user with specific snowflake.
func (*Store) UserImages ¶
UserImages returns slice of a user's images.
func (*Store) UserImagesPath ¶
UserImagesPath returns path to a user's images with specific snowflake.
func (*Store) UserMetadata ¶
UserMetadata sets user metadata.
func (*Store) UserMetadataPath ¶
UserMetadataPath returns path to a user's metadata file with specific snowflake.
func (*Store) UserPrivileged ¶
UserPrivileged sets privileged status of user with specific snowflake.
func (*Store) UserSecretRegen ¶
UserSecretRegen regenerates secret of user with specific snowflake.
func (*Store) UserUsername ¶
UserUsername sets username of user with specific snowflake.