mycontentapi

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatURL

func FormatURL[T mycontent.Data](baseURL string, params []string) func(t T)

FormatURL inplace

func New

func New[T mycontent.Data](
	uc mycontent.Usecase[T],
	baseURL string,
	refParams []string,
) *service[T]

func NewAttachment

func NewAttachment(
	base mycontent.UsecaseAttachment[*entity.Attachment],
	baseURL string,
	refParams []string,
	cacheControl string,
) *uploadService

Behave exatctly like the other API, but Can only do repository "Put" via Upload API

Types

type Authorization

type Authorization[T mycontent.Data] interface {
	// Custom post authorization
	CanPost(t T) *types.CommonError

	// Can read this entity?
	CanGet(t T) *types.CommonError

	// Can delete this entity?
	CanDelete(t T) *types.CommonError

	// Can delete parameter
	CheckBeforeDelete(namespace string, refIDs []string, ID string) *types.CommonError

	// Check get parameter
	CheckBeforeGet(namespace string, refIDs []string, ID string) *types.CommonError
}

Authorization for mycontent

type AuthorizationFactory

type AuthorizationFactory[T mycontent.Data] func(ctx context.Context, token string) (Authorization[T], *types.CommonError)

type PostProcess

type PostProcess[T mycontent.Data] func(t T)

type URLFormat

type URLFormat func(baseURL string, userID string, refIDs []string, ID string) string

URLFormat for custom URL (this should be the URL default)

Jump to

Keyboard shortcuts

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