Documentation
¶
Index ¶
- Constants
- type Attachment
- type AttachmentService
- type CreditRank
- type CreditRankShare
- type CreditRanks
- type CreditService
- type Plan
- type PlanUpdateFields
- type Provider
- type Share
- type ShareDetail
- type ShareExt
- type ShareFilter
- type ShareFinishFields
- type ShareService
- type ShareUpdateFields
- type User
- type UserBasic
- type UserBasics
- type UserInfo
- type UserLikeOrJoinShare
- type UserService
- type ValidateError
Constants ¶
View Source
const ( RelTypeLike int8 = 1 RelTypeJoin int8 = 2 )
View Source
const ( UserStatusEnabled int8 = 1 UserStatusDisabled int8 = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type AttachmentService ¶
type AttachmentService interface { GetByID(ctx context.Context, id int64) (*Attachment, error) CreateAttachment(ctx context.Context, atta Attachment) (int64, error) }
func NewAttachmentService ¶
func NewAttachmentService(cc infra.Resolver, db *sql.DB) AttachmentService
type CreditRank ¶
type CreditRankShare ¶
type CreditRankShare struct {}
type CreditRanks ¶
type CreditRanks []CreditRank
func (CreditRanks) Len ¶
func (t CreditRanks) Len() int
func (CreditRanks) Less ¶
func (t CreditRanks) Less(i, j int) bool
func (CreditRanks) Swap ¶
func (t CreditRanks) Swap(i, j int)
type CreditService ¶
type CreditService interface {
CreditRanks(ctx context.Context, startAt time.Time) (CreditRanks, error)
}
func NewCreditService ¶
func NewCreditService(cc infra.Resolver, db *sql.DB) CreditService
type PlanUpdateFields ¶
type ShareDetail ¶
type ShareDetail struct {}
type ShareFilter ¶
type ShareFilter struct {}
type ShareFinishFields ¶
type ShareFinishFields struct {}
type ShareService ¶
type ShareService interface { context.Context, id int64) (*ShareDetail, error) CreateShare(ctx context.Context, share Share) (int64, error) CreateOrUpdatePlan(ctx context.Context, shareID int64, plan PlanUpdateFields) (int64, error) RemovePlan(ctx context.Context, shareID int64) (bool, error) GetShares(ctx context.Context, filter ShareFilter, sortDesc bool, page int64, perPage int64) ([]ShareExt, query.PaginateMeta, error) FinishShare(ctx context.Context, shareID int64, sf ShareFinishFields) (bool, error) UpdateShare(ctx context.Context, id int64, share ShareUpdateFields) error RemoveShare(ctx context.Context, id int64) (bool, error) LikeShare(ctx context.Context, id int64, userID int64, positive bool) (bool, error) JoinShare(ctx context.Context, id int64, userID int64, positive bool) (bool, error) IsUserLikeOrJoinShares(ctx context.Context, userID int64, shareIDs []int64) (map[int64]UserLikeOrJoinShare, error) }GetShareByID(ctx
func NewShareService ¶
func NewShareService(cc infra.Resolver, db *sql.DB) ShareService
type ShareUpdateFields ¶
type ShareUpdateFields struct {}
type UserBasics ¶
type UserBasics []UserBasic
func (UserBasics) Len ¶
func (t UserBasics) Len() int
func (UserBasics) Less ¶
func (t UserBasics) Less(i, j int) bool
func (UserBasics) Swap ¶
func (t UserBasics) Swap(i, j int)
type UserLikeOrJoinShare ¶
type UserLikeOrJoinShare struct {}
type UserService ¶
type UserService interface { Users(ctx context.Context) (UserBasics, error) LoadUser(ctx context.Context, username string, userInfo UserInfo) (*UserInfo, error) LoadUserByAccount(ctx context.Context, account string) (*UserInfo, error) Register(ctx context.Context, username, password string) (*UserInfo, error) }
func NewUserService ¶
func NewUserService(cc infra.Resolver, db *sql.DB) UserService
type ValidateError ¶
type ValidateError struct {
// contains filtered or unexported fields
}
func NewValidateError ¶
func NewValidateError(err error) *ValidateError
func (*ValidateError) Error ¶
func (v *ValidateError) Error() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.