impl

package
v0.0.0-...-4751eea Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2017 License: BSD-2-Clause Imports: 38 Imported by: 0

Documentation

Overview

*

  • Warning: Generated code! do not change!
  • Generated by: go/AppCtx.ftl

*

  • Warning: Generated code! do not change!
  • Generated by: go/Roles.ftl

*

  • Generated by: go/Service.ftl

Index

Constants

View Source
const (
	ROLE_ADMIN = "ADMIN"
	ROLE_USER  = "USER"
)
View Source
const (
	UNKNOWN = "TB00"
	DBFAIL  = "TB01"
	DBLOCK  = "TB02"

	PRINCIPAL_KEY = "principal"
	JWT_TIMEOUT   = 15
)
View Source
const FAULT_BIZ = "BIZ"

Variables

View Source
var (
	TM db.ITransactionManager

	ContentDir string
	IpPort     string
	HttpsOnly  bool

	Poll *poller.Poller

	SmtpUser string
	SmtpPass string
	SmtpHost string
	SmtpPort string
	SmtpFrom string

	TaskBoardService service.ITaskBoardService

	ErrNoTokenInRequest = errors.New("no token present in request")
)
View Source
var (
	AbsentBoardFault     = dbx.NewPersistenceFail(FAULT_BIZ, "The Board no longer exists")
	AbsentLaneFault      = dbx.NewPersistenceFail(FAULT_BIZ, "The Lane no longer exists")
	OptimistickLockFault = dbx.NewOptimisticLockFail("Unable to apply changes due to a concurrent access. Try again.")
)

Functions

func AuthenticationFilter

func AuthenticationFilter(ctx maze.IContext) error

func ContextFactory

func ContextFactory(w http.ResponseWriter, r *http.Request, filters []*maze.Filter) maze.IContext

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

func GenerateRandomString

func GenerateRandomString(s int) (string, error)

func KeyFunction

func KeyFunction(token *jwt.Token) (interface{}, error)

func Limit

func Limit(ctx maze.IContext) (err error)

Limit limits the body of a post, compress response and format eventual errors

func LoginFilter

func LoginFilter(ctx maze.IContext) error

func NoTransactionFilter

func NoTransactionFilter(ctx maze.IContext) error

func PingFilter

func PingFilter(ctx maze.IContext) error

func SendMail

func SendMail(to []string, subject string, msg string)

func SendMailWithInsecureSkip

func SendMailWithInsecureSkip(addr string, a smtp.Auth, from string, to []string, msg []byte) error

retrived from: https://groups.google.com/forum/#!topic/golang-nuts/W95PXq99uns

func TransactionFilter

func TransactionFilter(ctx maze.IContext) error

Types

type AppCtx

type AppCtx struct {
	*maze.Context

	Principal *Principal
	Store     db.IDb
	// contains filtered or unexported fields
}

func NewAppCtx

func NewAppCtx(
	w http.ResponseWriter,
	r *http.Request,
	filters []*maze.Filter,
	taskBoardService service.ITaskBoardService,
) *AppCtx

func (*AppCtx) BuildJsonRpcTaskBoardService

func (this *AppCtx) BuildJsonRpcTaskBoardService(transaction func(ctx maze.IContext) error) *maze.JsonRpc

func (*AppCtx) GetTaskBoardService

func (this *AppCtx) GetTaskBoardService() service.ITaskBoardService

func (*AppCtx) Proceed

func (this *AppCtx) Proceed() error

func (*AppCtx) Reply

func (this *AppCtx) Reply(value interface{}) error

func (*AppCtx) SetTaskBoardService

func (this *AppCtx) SetTaskBoardService(taskBoardService service.ITaskBoardService)

type Principal

type Principal struct {
	UserId   int64
	Username string
	Roles    []lov.ERole
	Version  int64
}

func (*Principal) HasRole

func (this *Principal) HasRole(role lov.ERole) bool

type TaskBoardServiceImpl

type TaskBoardServiceImpl struct {
}

func (*TaskBoardServiceImpl) AddLane

func (this *TaskBoardServiceImpl) AddLane(ctx maze.IContext, boardId int64) error

func (*TaskBoardServiceImpl) AddUserToBoard

func (this *TaskBoardServiceImpl) AddUserToBoard(ctx maze.IContext, input service.AddUserToBoardIn) error

param boardId param userId return

func (*TaskBoardServiceImpl) ChangeUserPassword

func (this *TaskBoardServiceImpl) ChangeUserPassword(c maze.IContext, input service.ChangeUserPasswordIn) (string, error)

param oldPwd param newPwd return

func (*TaskBoardServiceImpl) DeleteBoard

func (this *TaskBoardServiceImpl) DeleteBoard(ctx maze.IContext, id int64) error

param idVersion return

func (*TaskBoardServiceImpl) DeleteLastLane

func (this *TaskBoardServiceImpl) DeleteLastLane(ctx maze.IContext, boardId int64) error

if lane is the last one remove all tasks, if not, move all tasks to the previous lane param idVersion return

func (*TaskBoardServiceImpl) DeleteNotification

func (this *TaskBoardServiceImpl) DeleteNotification(ctx maze.IContext, id int64) error

param id return

func (*TaskBoardServiceImpl) DeleteUser

func (this *TaskBoardServiceImpl) DeleteUser(c maze.IContext, iv dto.IdVersionDTO) error

param userId return

func (*TaskBoardServiceImpl) FetchBoardAllUsers

func (this *TaskBoardServiceImpl) FetchBoardAllUsers(c maze.IContext, criteria dto.BoardUserSearchDTO) (app.Page, error)

param criteria return

func (*TaskBoardServiceImpl) FetchBoardById

func (this *TaskBoardServiceImpl) FetchBoardById(c maze.IContext, id int64) (*entity.Board, error)

param id return

func (*TaskBoardServiceImpl) FetchBoardUsers

func (this *TaskBoardServiceImpl) FetchBoardUsers(c maze.IContext, id int64) ([]dto.BoardUserDTO, error)

func (*TaskBoardServiceImpl) FetchBoards

func (this *TaskBoardServiceImpl) FetchBoards(c maze.IContext, criteria dto.BoardSearchDTO) (app.Page, error)

param criteria return

func (*TaskBoardServiceImpl) FetchNotifications

func (this *TaskBoardServiceImpl) FetchNotifications(c maze.IContext, criteria dto.NotificationSearchDTO) (app.Page, error)

param taskId return

func (*TaskBoardServiceImpl) FetchUsers

func (this *TaskBoardServiceImpl) FetchUsers(ctx maze.IContext, criteria dto.UserSearchDTO) (app.Page, error)

param criteria return

func (*TaskBoardServiceImpl) FullyLoadBoardById

func (this *TaskBoardServiceImpl) FullyLoadBoardById(c maze.IContext, id int64) (*entity.Board, error)

func (*TaskBoardServiceImpl) MoveTask

func (this *TaskBoardServiceImpl) MoveTask(c maze.IContext, in service.MoveTaskIn) error

param idVersion return

func (*TaskBoardServiceImpl) RemoveUserFromBoard

func (this *TaskBoardServiceImpl) RemoveUserFromBoard(ctx maze.IContext, input service.RemoveUserFromBoardIn) error

param boardId param userId return

func (*TaskBoardServiceImpl) SaveBoard

func (this *TaskBoardServiceImpl) SaveBoard(ctx maze.IContext, board *entity.Board) (*entity.Board, error)

param board return

func (*TaskBoardServiceImpl) SaveLane

func (this *TaskBoardServiceImpl) SaveLane(ctx maze.IContext, lane *entity.Lane) (*entity.Lane, error)

param lane return

func (*TaskBoardServiceImpl) SaveNotification

func (this *TaskBoardServiceImpl) SaveNotification(ctx maze.IContext, notification *entity.Notification) (*entity.Notification, error)

param task return

func (*TaskBoardServiceImpl) SaveTask

func (this *TaskBoardServiceImpl) SaveTask(c maze.IContext, task *entity.Task) (*entity.Task, error)

param task return

func (*TaskBoardServiceImpl) SaveUser

func (this *TaskBoardServiceImpl) SaveUser(c maze.IContext, user dto.UserDTO) (bool, error)

param user return

func (*TaskBoardServiceImpl) SaveUserName

func (this *TaskBoardServiceImpl) SaveUserName(c maze.IContext, name *string) error

param name return

func (*TaskBoardServiceImpl) WhoAmI

Jump to

Keyboard shortcuts

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