service

package
v0.0.0-...-29f350e Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AuthCodeSecretKey ...
	AuthCodeSecretKey = "AUTH_CODE_SECRET_KEY"
	// AccessTokenSecretKey ...
	AccessTokenSecretKey = "ACCESS_TOKEN_SECRET_KEY"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlarmService

type AlarmService interface {
	Create(memberID, roomID uint, code vo.TaskCode, roomName, diaryTitle, authorNickname string) (*entity.Alarm, error)
	GetAll(memberID uint) (*entity.Alarms, error)
	PushByID(memberID uint, al *entity.Alarm) error
	PushByEmail(email string, al *entity.Alarm) error
	BroadCast(memberIDs []uint, al *entity.Alarm) error
}

AlarmService ...

func NewAlarmService

NewAlarmService ...

type FileService

type FileService interface {
	UploadFile(bkt *cloudstorage.VBucket, roomID uint, fileUUID string, file *multipart.FileHeader, ftype FileType) (vItem *cloudstorage.VItem, err error)
}

FileService ...

func NewFileService

func NewFileService() FileService

NewFileService ...

type FileType

type FileType int

FileType handles kind of static file type which voda handles.

const (
	// AudioType ...
	AudioType FileType = iota
	// PhotoType ...
	PhotoType
)

type MemberService

type MemberService interface {
	Create(email string, name string, profileURL string, authType string) (*entity.Member, error)
	Get(ID uint) (*entity.Member, error)
	GetByEmail(email string) (*entity.Member, error)
	Update(member *entity.Member) (*entity.Member, error)
	Delete(email string) error
	VerifyNickName(name string) (bool, error)
}

MemberService ...

func NewMemberService

func NewMemberService(repository repository.MemberRepository) MemberService

NewMemberService ...

type RoomMemberService

type RoomMemberService interface {
	Add(roomID, accountID uint) (*entity.RoomMember, error)
	Get(roomID, accountID uint) (*entity.RoomMember, error)
	GetAllRoomIDs(accountID uint) ([]uint, error)
	Delete(roomID, accountID uint) error
	PopulateRoomsMembers(rooms *entity.Rooms) (*entity.Rooms, error)
	PopulateRoomMembers(room *entity.Room) (*entity.Room, error)
	PopulateMembersByOrders(room *entity.Room) (*entity.Room, error)
}

RoomMemberService ...

func NewRoomMemberService

NewRoomMemberService ...

type RoomService

type RoomService interface {
	Create(masterID uint, name, code, hint, theme string, period uint8) (*entity.Room, error)
	Get(id uint, orderBy entity.RoomMemberOrderBy) (*entity.Room, error)
	GetAllJoinedRooms(accountID uint) (*entity.Rooms, error)
	Update(room *entity.Room) (*entity.Room, error)
	Delete(room *entity.Room) error
	JoinRoom(id, accountID uint, code string) (bool, error)
	LeaveRoom(id, accountID uint) error
}

RoomService ...

func NewRoomService

NewRoomService ...

type TaskService

type TaskService interface {
	DoRoomPeriodFINTask(roomID uint, baseURL string) error
	DoMemberOnDutyTask(roomID uint, email string) (err error)
	DoMemberBeforeTask(roomID uint, email string, code vo.TaskCode) (err error)
	DoMemberPostedDiaryTask(roomID uint, baseURL string) error

	RegisterRoomPeriodFINTask(c *tasks.Client, baseURL string, roomID, accountID uint, dueAt *time.Time) (taskID string, err error)
	RegisterMemberPostedDiaryTask(roomID uint, baseURL string) (taskID string, err error)

	GetTask(c *tasks.Client, code vo.TaskCode, roomID, turnAccountID uint) (*taskspb.Task, error)
	DeleteTask(c *tasks.Client, code vo.TaskCode, roomID, turnAccountID uint) error
}

TaskService ...

func NewTaskService

func NewTaskService(as AlarmService, rs RoomService, ms MemberService) TaskService

NewTaskService ...

type TokenService

type TokenService interface {
	IssueAuthCode(email string, authType string) (string, error)
	IssueAccessToken(authCode, deviceToken string) (string, error)
	IssueRefreshToken(authCode string) (string, error)
	RefreshAccessToken(refreshToken string) (string, error)
}

TokenService ...

func NewTokenService

func NewTokenService(service MemberService, authCodeVerifier TokenVerifier, refreshTokenVerifier TokenVerifier, mdr repository.MemberDeviceRepository) TokenService

NewTokenService ...

type TokenVerifier

type TokenVerifier struct {
	SecretKey string
}

TokenVerifier ...

func NewTokenVerifier

func NewTokenVerifier(secretKey string) TokenVerifier

NewTokenVerifier ...

func (*TokenVerifier) Verify

func (t *TokenVerifier) Verify(authCode string) (claims *entity.AuthCodeClaims, err error)

Verify ...

Jump to

Keyboard shortcuts

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