Documentation
¶
Index ¶
Constants ¶
const ImageResultPerPage = 24
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKey ¶
type APIKey struct {
Id string
OrganizationUserId string
Name string
KeyPrefix string
LastUsedAt *time.Time
RevokedAt *time.Time
CreatedAt time.Time
}
APIKey is a credential that lets an organization user call the HTTP API (e.g. /api/v1/createImages) without a browser session. The secret itself is never stored; only its hash and a short, displayable prefix are kept.
type ExternalImageIdentifier ¶
type Image ¶
type Image struct {
Id string
CreatedById string
CreatedAt time.Time
Name string
Identifier string
RootId string
ParentId string
Changes string
UploaderIP string
MIMEType string
NominalWidth int32
NominalHeight int32
NominalByteSize int32
// ExpiresAt is when the image expires. nil means it never expires.
// Expiry is only designed to transition an image to deleted, with no
// other special handling.
ExpiresAt *time.Time
}
func (*Image) GetURL ¶
func (i *Image) GetURL(imageDomain string, isSecure bool, storedImages []*ExternalImageIdentifier, format ImageURLFormat) string
func (*Image) ToPublic ¶
func (i *Image) ToPublic() *PublicImage
ToPublic returns the public view of the image.
type ImageOrderField ¶
type ImageOrderField struct {
pagination.BaseOrderField
}
func NewImageOrderField ¶
func NewImageOrderField(name string, asc bool) *ImageOrderField
func (*ImageOrderField) GetValue ¶
func (f *ImageOrderField) GetValue(object interface{}) string
func (*ImageOrderField) Reverse ¶
func (f *ImageOrderField) Reverse() pagination.OrderField
type ImageURLFormat ¶
type ImageURLFormat string
const ( ImageURLFormat_CANONICAL ImageURLFormat = "canonical" ImageURLFormat_DIRECT ImageURLFormat = "direct" ImageURLFormat_BACKEND_DIRECT ImageURLFormat = "backend_direct" )
func (ImageURLFormat) IsValid ¶
func (f ImageURLFormat) IsValid() bool
type ListImageResult ¶
type Organization ¶
type OrganizationUser ¶
type OrganizationUser struct {
Id string
Organization *Organization
User *User
Roles []*Role
UploadLimitBytes *int64
}
func (*OrganizationUser) CanManage ¶
func (ou *OrganizationUser) CanManage(other *OrganizationUser) bool
func (*OrganizationUser) HasAdminAccess ¶
func (ou *OrganizationUser) HasAdminAccess() bool
func (*OrganizationUser) IsSiteOwner ¶
func (ou *OrganizationUser) IsSiteOwner() bool
type PublicImage ¶
type PublicImage struct {
Id string
CreatedAt time.Time
Name string
Identifier string
MIMEType string
NominalWidth int32
NominalHeight int32
NominalByteSize int32
// Not for display; lets callers tell whether the viewer owns the image.
CreatedById string
}
PublicImage is the part of an Image that can be shown to anyone, including anonymous visitors.
Any live image can be fetched by its link without authentication, so this view only exposes what a link holder can already see (content, size, type), plus its name and upload time. It must not expose the owner or related images (lineage, edit changes, stored copies): e.g. a blurred image's base parent is the unblurred original.
func (*PublicImage) GetURL ¶
func (i *PublicImage) GetURL(imageDomain string, isSecure bool, storedImages []*ExternalImageIdentifier, format ImageURLFormat) string
func (*PublicImage) IsOwnedBy ¶
func (i *PublicImage) IsOwnedBy(organizationUserId string) bool
IsOwnedBy reports whether the image was uploaded by the given organization user.
type StorageDefinition ¶
type StorageTypeName ¶
type StorageTypeName string
const ( S3StorageType StorageTypeName = "s3" FSStorageType StorageTypeName = "fs" WebDavStorageType StorageTypeName = "webdav" IPFSMFSStorageType StorageTypeName = "ipfs_mfs" )
func (StorageTypeName) IsValid ¶
func (s StorageTypeName) IsValid() bool
type StoredImage ¶
type UserWithOrganizationUsers ¶
type UserWithOrganizationUsers struct {
User *User
OrganizationUsers []*OrganizationUser
}