Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidMimeType = errors.New("invalid mime type") ErrMimeTypeNotAllowed = errors.New("mime/content type not allowed") )
View Source
var (
ErrBlobNotFound = errors.New("blob not found")
)
View Source
var (
ErrFileSizeLimit = errors.New("file size is greater than allowed")
)
Functions ¶
This section is empty.
Types ¶
type ACR ¶
type ACR struct {
Action ACRAction
Pubkey string
Resource ACRResource
}
type ACRResource ¶
type ACRResource string
const ( ResourceUpload ACRResource = "UPLOAD" ResourceGet ACRResource = "GET" ResourceDelete ACRResource = "DELETE" ResourceList ACRResource = "LIST" ResourceMirror ACRResource = "MIRROR" )
type ACRStorage ¶
type ACRStorage interface {
Validate(
ctx context.Context,
pubkey string,
resource ACRResource,
) error
}
type BlobStorage ¶
type BlobStorage interface {
Save(
ctx context.Context,
pubkey string,
sha256 string,
url string,
size int64,
mimeType string,
blob []byte,
created int64,
) (*Blob, error)
Exists(ctx context.Context, sha256 string) (bool, error)
GetFromHash(ctx context.Context, sha256 string) (*Blob, error)
GetFromPubkey(ctx context.Context, pubkey string) ([]*Blob, error)
GetFromPubkeyPaginated(ctx context.Context, pubkey string, since int64, until int64) ([]*Blob, error)
DeleteFromHash(ctx context.Context, sha256 string) error
}
type MimeTypeService ¶
type NIP94FileMetadata ¶
type Services ¶
type Services interface {
Init(context.Context) error
Blob() BlobStorage
ACR() ACRStorage
Mime() MimeTypeService
Settings() SettingService
Stats() StatService
}
type SettingService ¶
Click to show internal directories.
Click to hide internal directories.