assets

package
v1.87.5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultErrorHandler

func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, code int)

func DownloadHandleFunc

func DownloadHandleFunc(s AssetsService, downloader Downloader) func(http.ResponseWriter, *http.Request)

func NewHandler

func NewHandler(
	commands *command.Commands,
	verifier *authz.TokenVerifier,
	authConfig authz.Config,
	idGenerator id.Generator,
	storage static.Storage,
	queries *query.Queries,
) http.Handler

func UploadHandleFunc

func UploadHandleFunc(s AssetsService, uploader Uploader) func(http.ResponseWriter, *http.Request)

Types

type Downloader

type Downloader interface {
	ObjectName(ctx context.Context, path string) (string, error)
	BucketName(ctx context.Context, id string) string
}

type ErrorHandler

type ErrorHandler func(http.ResponseWriter, *http.Request, error, int)

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) AuthInterceptor

func (h *Handler) AuthInterceptor() *http_mw.AuthInterceptor

func (*Handler) Commands

func (h *Handler) Commands() *command.Commands

func (*Handler) ErrorHandler

func (h *Handler) ErrorHandler() ErrorHandler

func (*Handler) GetDefaultLabelPolicyFont

func (h *Handler) GetDefaultLabelPolicyFont() Downloader

func (*Handler) GetDefaultLabelPolicyIcon

func (h *Handler) GetDefaultLabelPolicyIcon() Downloader

func (*Handler) GetDefaultLabelPolicyIconDark

func (h *Handler) GetDefaultLabelPolicyIconDark() Downloader
func (h *Handler) GetDefaultLabelPolicyLogo() Downloader

func (*Handler) GetDefaultLabelPolicyLogoDark

func (h *Handler) GetDefaultLabelPolicyLogoDark() Downloader

func (*Handler) GetFile

func (h *Handler) GetFile() Downloader

func (*Handler) GetMyUserAvatar

func (h *Handler) GetMyUserAvatar() Downloader

func (*Handler) GetOrgLabelPolicyFont

func (h *Handler) GetOrgLabelPolicyFont() Downloader

func (*Handler) GetOrgLabelPolicyIcon

func (h *Handler) GetOrgLabelPolicyIcon() Downloader

func (*Handler) GetOrgLabelPolicyIconDark

func (h *Handler) GetOrgLabelPolicyIconDark() Downloader
func (h *Handler) GetOrgLabelPolicyLogo() Downloader

func (*Handler) GetOrgLabelPolicyLogoDark

func (h *Handler) GetOrgLabelPolicyLogoDark() Downloader

func (*Handler) GetPreviewDefaultLabelPolicyFont

func (h *Handler) GetPreviewDefaultLabelPolicyFont() Downloader

func (*Handler) GetPreviewDefaultLabelPolicyIcon

func (h *Handler) GetPreviewDefaultLabelPolicyIcon() Downloader

func (*Handler) GetPreviewDefaultLabelPolicyIconDark

func (h *Handler) GetPreviewDefaultLabelPolicyIconDark() Downloader
func (h *Handler) GetPreviewDefaultLabelPolicyLogo() Downloader

func (*Handler) GetPreviewDefaultLabelPolicyLogoDark

func (h *Handler) GetPreviewDefaultLabelPolicyLogoDark() Downloader

func (*Handler) GetPreviewOrgLabelPolicyFont

func (h *Handler) GetPreviewOrgLabelPolicyFont() Downloader

func (*Handler) GetPreviewOrgLabelPolicyIcon

func (h *Handler) GetPreviewOrgLabelPolicyIcon() Downloader

func (*Handler) GetPreviewOrgLabelPolicyIconDark

func (h *Handler) GetPreviewOrgLabelPolicyIconDark() Downloader
func (h *Handler) GetPreviewOrgLabelPolicyLogo() Downloader

func (*Handler) GetPreviewOrgLabelPolicyLogoDark

func (h *Handler) GetPreviewOrgLabelPolicyLogoDark() Downloader

func (*Handler) Storage

func (h *Handler) Storage() static.Storage

func (*Handler) UploadDefaultLabelPolicyFont

func (h *Handler) UploadDefaultLabelPolicyFont() Uploader

func (*Handler) UploadDefaultLabelPolicyIcon

func (h *Handler) UploadDefaultLabelPolicyIcon() Uploader

func (*Handler) UploadDefaultLabelPolicyIconDark

func (h *Handler) UploadDefaultLabelPolicyIconDark() Uploader
func (h *Handler) UploadDefaultLabelPolicyLogo() Uploader

func (*Handler) UploadDefaultLabelPolicyLogoDark

func (h *Handler) UploadDefaultLabelPolicyLogoDark() Uploader

func (*Handler) UploadMyUserAvatar

func (h *Handler) UploadMyUserAvatar() Uploader

func (*Handler) UploadOrgLabelPolicyFont

func (h *Handler) UploadOrgLabelPolicyFont() Uploader

func (*Handler) UploadOrgLabelPolicyIcon

func (h *Handler) UploadOrgLabelPolicyIcon() Uploader

func (*Handler) UploadOrgLabelPolicyIconDark

func (h *Handler) UploadOrgLabelPolicyIconDark() Uploader
func (h *Handler) UploadOrgLabelPolicyLogo() Uploader

func (*Handler) UploadOrgLabelPolicyLogoDark

func (h *Handler) UploadOrgLabelPolicyLogoDark() Uploader

type Uploader

type Uploader interface {
	Callback(ctx context.Context, info *domain.AssetInfo, orgID string, commands *command.Commands) error
	ObjectName(data authz.CtxData) (string, error)
	BucketName(data authz.CtxData) string
	ContentTypeAllowed(contentType string) bool
	MaxFileSize() int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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