assets

package
v0.0.0-...-860e413 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HandlerPrefix = "/assets/v1"
)

Variables

This section is empty.

Functions

func AssetAPI

func AssetAPI(externalSecure bool) func(context.Context) string

func AssetAPIFromDomain

func AssetAPIFromDomain(externalSecure bool, externalPort uint16) func(context.Context) string

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 GetAsset

func GetAsset(w http.ResponseWriter, r *http.Request, resourceOwner, objectName string, storage static.Storage) error

func NewHandler

func NewHandler(commands *command.Commands, verifier *authz.TokenVerifier, authConfig authz.Config, idGenerator id.Generator, storage static.Storage, queries *query.Queries, instanceInterceptor, assetCacheInterceptor func(handler http.Handler) http.Handler) 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)
	ResourceOwner(ctx context.Context, ownerPath 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 {
	UploadAsset(ctx context.Context, info string, asset *command.AssetUpload, commands *command.Commands) error
	ObjectName(data authz.CtxData) (string, error)
	ResourceOwner(instance authz.Instance, data authz.CtxData) string
	ContentTypeAllowed(contentType string) bool
	MaxFileSize() int64
	ObjectType() static.ObjectType
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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