handler

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustLang

func AdjustLang(lang string) string

func AdjustPaging

func AdjustPaging(pageSize, pageNo int32) (int, int)

func ComposeListOpusResp

func ComposeListOpusResp(ctx context.Context, total int64, opuses []*model.Opus, trans i18n.Translator) *pb.ListOpusResp

func ComposeListOpusVersionRespWithOpus

func ComposeListOpusVersionRespWithOpus(lang string, resp *pb.ListOpusVersionsResp, opus *model.Opus)

func ComposeListOpusVersionRespWithPresentations

func ComposeListOpusVersionRespWithPresentations(lang string, resp *pb.ListOpusVersionsResp, presentations []*model.OpusPresentation)

func ComposeListOpusVersionRespWithReadmes

func ComposeListOpusVersionRespWithReadmes(resp *pb.ListOpusVersionsResp, lang string, readmes []*model.OpusReadme)

func ComposeListOpusVersionRespWithVersions

func ComposeListOpusVersionRespWithVersions(lang string, resp *pb.ListOpusVersionsResp, versions []*model.OpusVersion) error

func ConvertContentToExtension

func ConvertContentToExtension(content *structpb.Value) (*pb.PutOnExtensionsReq, error)

func GenOpusUpdates

func GenOpusUpdates(userID, versionID, summary, summaryI18n, displayName, displayNameI18n, logoURL string, isDefault bool) map[string]interface{}

func GenPresentationFromReq

func GenPresentationFromReq(opusID, versionID string, common model.Common, req *pb.PutOnExtensionsReq) model.OpusPresentation

func ListOpusTypes

func ListOpusTypes(ctx context.Context, tran i18n.Translator) *pb.ListOpusTypesRespData

func PrepareListOpusesKeywordFilterOption

func PrepareListOpusesKeywordFilterOption(keyword string, versions []*model.OpusVersion) dao.Option

func PrepareListOpusesOptions

func PrepareListOpusesOptions(orgID int64, type_, name, keyword string, pageSize, pageNo int) []dao.Option

func PrepareListVersionsInOpusesIDsOption

func PrepareListVersionsInOpusesIDsOption(opuses []*model.Opus) dao.Option

func RenderI18n

func RenderI18n(value *string, values, lang string) error

Types

type GalleryHandler

type GalleryHandler struct {
	C    *cache.Cache
	L    *logrus.Entry
	Tran i18n.Translator
}

func (*GalleryHandler) ExtensionHook

func (*GalleryHandler) ListOpus

func (p *GalleryHandler) ListOpus(ctx context.Context, req *pb.ListOpusReq) (*pb.ListOpusResp, error)

func (*GalleryHandler) ListOpusTypes

func (*GalleryHandler) ListOpusVersions

func (p *GalleryHandler) ListOpusVersions(ctx context.Context, req *pb.ListOpusVersionsReq) (*pb.ListOpusVersionsResp, error)

func (*GalleryHandler) PutOffArtifacts

func (p *GalleryHandler) PutOffArtifacts(ctx context.Context, req *pb.PutOffArtifactsReq) (*commonPb.VoidResponse, error)

func (*GalleryHandler) PutOnArtifacts

func (p *GalleryHandler) PutOnArtifacts(ctx context.Context, req *pb.PutOnArtifactsReq) (*pb.PutOnOpusResp, error)

func (*GalleryHandler) PutOnExtensions

func (p *GalleryHandler) PutOnExtensions(ctx context.Context, req *pb.PutOnExtensionsReq) (*pb.PutOnOpusResp, error)

Jump to

Keyboard shortcuts

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