base

package
v0.0.0-...-85b3044 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBindAnyFn

func NewBindAnyFn() func(c *gin.Context, obj any) mir.Error

func OnCacheRespEvent

func OnCacheRespEvent(ac core.AppCache, key string, data any, expire int64)

func OnExpireAnyRespEvent

func OnExpireAnyRespEvent(ac core.AppCache, pattern string)

func OnExpireRespEvent

func OnExpireRespEvent(ac core.AppCache, keys ...string)

func RenderAny

func RenderAny(c *gin.Context, data any, err mir.Error)

func UserFrom

func UserFrom(c *gin.Context) (*ms.User, bool)

func UserIdFrom

func UserIdFrom(c *gin.Context) (int64, bool)

func UserNameFrom

func UserNameFrom(c *gin.Context) (string, bool)

Types

type BaseServant

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

func NewBaseServant

func NewBaseServant() *BaseServant

func (*BaseServant) Bind

func (s *BaseServant) Bind(c *gin.Context, obj any) mir.Error

func (*BaseServant) Render

func (s *BaseServant) Render(c *gin.Context, data any, err mir.Error)

type CacheRespEvent

type CacheRespEvent struct {
	event.UnimplementedEvent
	// contains filtered or unexported fields
}

func (*CacheRespEvent) Action

func (p *CacheRespEvent) Action() error

func (*CacheRespEvent) Name

func (p *CacheRespEvent) Name() string

type DaoServant

type DaoServant struct {
	*BaseServant

	Dsa   core.WebDataServantA
	Ds    core.DataService
	Ts    core.TweetSearchService
	Redis core.RedisCache
}

func NewDaoServant

func NewDaoServant() *DaoServant

func (*DaoServant) DeleteSearchPost

func (s *DaoServant) DeleteSearchPost(post *ms.Post) error

func (*DaoServant) GetTweetBy

func (s *DaoServant) GetTweetBy(id int64) (*ms.PostFormated, error)

func (*DaoServant) PrepareMessages

func (s *DaoServant) PrepareMessages(userId int64, messages []*ms.MessageFormated) error

func (*DaoServant) PrepareTweet

func (s *DaoServant) PrepareTweet(userId int64, tweet *ms.PostFormated) error

func (*DaoServant) PrepareTweets

func (s *DaoServant) PrepareTweets(userId int64, tweets []*ms.PostFormated) error

func (*DaoServant) PrepareUser

func (s *DaoServant) PrepareUser(userId int64, user *ms.UserFormated) error

func (*DaoServant) PushAllPostToSearch

func (s *DaoServant) PushAllPostToSearch()

func (*DaoServant) PushPostToSearch

func (s *DaoServant) PushPostToSearch(post *ms.Post)

func (*DaoServant) RelationTypFrom

func (s *DaoServant) RelationTypFrom(me *ms.User, username string) (res *cs.VistUser, err error)

type ExpireAnyRespEvent

type ExpireAnyRespEvent struct {
	event.UnimplementedEvent
	// contains filtered or unexported fields
}

func (*ExpireAnyRespEvent) Action

func (p *ExpireAnyRespEvent) Action() error

func (*ExpireAnyRespEvent) Name

func (p *ExpireAnyRespEvent) Name() string

type ExpireRespEvent

type ExpireRespEvent struct {
	event.UnimplementedEvent
	// contains filtered or unexported fields
}

func (*ExpireRespEvent) Action

func (p *ExpireRespEvent) Action() error

func (*ExpireRespEvent) Name

func (p *ExpireRespEvent) Name() string

type PageInfoSetter

type PageInfoSetter interface {
	SetPageInfo(page, pageSize int)
}

type PageResp

type PageResp struct {
	List  any   `json:"list"`
	Pager Pager `json:"pager"`
}

func PageRespFrom

func PageRespFrom(list any, page int, pageSize int, totalRows int64) *PageResp

type Pager

type Pager struct {
	Page      int   `json:"page"`
	PageSize  int   `json:"page_size"`
	TotalRows int64 `json:"total_rows"`
}

type SentryHubSetter

type SentryHubSetter interface {
	SetSentryHub(hub *sentry.Hub)
}

type UserIdSetter

type UserIdSetter interface {
	SetUserId(int64)
}

type UserSetter

type UserSetter interface {
	SetUser(*ms.User)
}

Jump to

Keyboard shortcuts

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