api

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleGetFileMetadata

func HandleGetFileMetadata(getMetadata GetFileMetadata) http.HandlerFunc

func HandleMarkCollectionPublished

func HandleMarkCollectionPublished(markCollectionPublished MarkCollectionPublished) http.HandlerFunc

func HandleMarkFileMoved added in v1.3.0

func HandleMarkFileMoved(markMovementComplete MarkMovementComplete) http.HandlerFunc

func HandleMarkFilePublished

func HandleMarkFilePublished(markFilePublished MarkFilePublished) http.HandlerFunc

func HandleMarkUploadComplete

func HandleMarkUploadComplete(markUploaded MarkUploadComplete) http.HandlerFunc

func HandlerGetFilesMetadata

func HandlerGetFilesMetadata(getFilesMetadata GetFilesMetadata) http.HandlerFunc

func HandlerRegisterUploadStarted

func HandlerRegisterUploadStarted(register RegisterFileUpload, deadlineDuration time.Duration) http.HandlerFunc

func HandlerUpdateCollectionID

func HandlerUpdateCollectionID(updateCollectionID UpdateCollectionID) http.HandlerFunc

func PatchRequestToHandler

func PatchRequestToHandler(handlers PatchRequestHandlers) http.HandlerFunc

Types

type CollectionChange

type CollectionChange struct {
	CollectionID string `json:"collection_id"`
}

type EtagChange

type EtagChange struct {
	Etag string `json:"etag" validate:"required"`
}

type FilesCollection

type FilesCollection struct {
	Count      int64                            `json:"count"`
	Limit      int64                            `json:"limit"`
	Offset     int64                            `json:"offset"`
	TotalCount int64                            `json:"total_count"`
	Items      []files.StoredRegisteredMetaData `json:"items"`
}

type GetFileMetadata

type GetFileMetadata func(ctx context.Context, path string) (files.StoredRegisteredMetaData, error)

type GetFilesMetadata

type GetFilesMetadata func(ctx context.Context, collectionID string) ([]files.StoredRegisteredMetaData, error)

type MarkCollectionPublished

type MarkCollectionPublished func(ctx context.Context, collectionID string) error

type MarkFilePublished

type MarkFilePublished func(ctx context.Context, path string) error

type MarkMovementComplete added in v1.3.0

type MarkMovementComplete func(ctx context.Context, change files.FileEtagChange) error

type MarkUploadComplete

type MarkUploadComplete func(ctx context.Context, metaData files.FileEtagChange) error

type PatchRequestHandlers

type PatchRequestHandlers struct {
	UploadComplete   http.HandlerFunc
	Published        http.HandlerFunc
	Moved            http.HandlerFunc
	CollectionUpdate http.HandlerFunc
}

type RegisterFileUpload

type RegisterFileUpload func(ctx context.Context, metaData files.StoredRegisteredMetaData) error

type RegisterMetadata

type RegisterMetadata struct {
	Path          string  `json:"path" validate:"required,aws-upload-key"`
	IsPublishable *bool   `json:"is_publishable,omitempty" validate:"required"`
	CollectionID  *string `json:"collection_id,omitempty"`
	Title         string  `json:"title"`
	SizeInBytes   uint64  `json:"size_in_bytes" validate:"gt=0"`
	Type          string  `json:"type"`
	Licence       string  `json:"licence" validate:"required"`
	LicenceUrl    string  `json:"licence_url" validate:"required"`
}

type StateMetadata

type StateMetadata struct {
	State        *string `json:"state,omitempty"`
	CollectionID *string `json:"collection_id,omitempty"`
}

type UpdateCollectionID

type UpdateCollectionID func(ctx context.Context, path, collectionID string) error

Jump to

Keyboard shortcuts

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