Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct { UserDAO *UserDAO PlanDAO *PlanDAO PlanSessionDAO *PlanSessionDAO // contains filtered or unexported fields }
Conn handle db connection and DAO instanciation.
func Open ¶
func Open(conf *configuration.GlobalConf) (conn *Conn)
Open init connection to database and init all prepared statement. If something wrong happened, it panics.
type DbError ¶
type DbError struct { Message string Type DbErrorType }
DbError allow to give more context when an error happend in DAO layer
type DbErrorType ¶
type DbErrorType string
const ( CONFLICT DbErrorType = "conflict" UNKNOWN DbErrorType = "unknown" NOT_FOUND DbErrorType = "not_found" )
type PlanDAO ¶
type PlanDAO struct {
// contains filtered or unexported fields
}
PlanDAO allow accessing plan table
type PlanSessionDAO ¶
type PlanSessionDAO struct {
// contains filtered or unexported fields
}
PlanDAO allow accessing plan table
func (*PlanSessionDAO) Insert ¶
func (p *PlanSessionDAO) Insert(ctx context.Context, planSession *model.PlanSession) (*model.PlanSession, *DbError)
Insert a new plan
Click to show internal directories.
Click to hide internal directories.