Documentation ¶
Index ¶
- Constants
- Variables
- func CreateActionLink(db gfsql.DB, action *Action, user *User) error
- func CreateRoleAction(db gfsql.DB, role *Role, action *Action) error
- func CreateRoleLink(db gfsql.DB, role *Role, user *User) error
- func DeleteActionByID(db gfsql.DB, serviceIID uint32, actionID string) error
- func DeleteActionByIID(db gfsql.DB, serviceIID uint32, actionIID uint32) error
- func DeleteActionLink(db gfsql.DB, action *Action, user *User) error
- func DeleteRoleAction(db gfsql.DB, role *Role, action *Action) error
- func DeleteRoleByID(db gfsql.DB, teamIID uint32, roleID string) error
- func DeleteRoleByIID(db gfsql.DB, roleIID uint32) error
- func DeleteRoleLink(db gfsql.DB, role *Role, user *User) error
- func DeleteServiceByID(db gfsql.DB, serviceID string) error
- func DeleteServiceByIID(db gfsql.DB, serviceIID uint32) error
- func DeleteTeamByID(db gfsql.DB, teamID string) error
- func DeleteTeamByIID(db gfsql.DB, teamIID uint32) error
- func DeleteUserByID(db gfsql.DB, teamIID uint32, userID string) error
- func DeleteUserByIID(db gfsql.DB, userIID uint32) error
- func UpsertActionLink(db gfsql.DB, action *Action, user *User) error
- type Action
- type ActionLink
- type Password
- type Role
- type RoleAction
- type RoleLink
- type Service
- type Session
- type Team
- type User
Constants ¶
View Source
const ExpirationInterval = 1 * 24 * -1
1 day
View Source
const SqlCreateAction = "INSERT INTO `actions` (`service_iid`, `id`) VALUE (:service_iid, :action_id)"
View Source
const SqlCreateActionLink = "INSERT `action_links` (`action_iid`, `user_iid`) VALUE (:action_iid, :user_iid)"
View Source
const SqlCreateRole = "INSERT INTO `roles` (`team_iid`,`id`) VALUE (:team_iid, :role_id)"
View Source
const SqlCreateRoleAction = "INSERT INTO `role_actions` (`role_iid`, `action_iid`) VALUE (:role_iid, :action_iid)"
View Source
const SqlCreateRoleLink = "INSERT `role_links` (`role_iid`, `user_iid`) VALUE (:role_iid, :user_iid)"
View Source
const SqlCreateService = "INSERT INTO `services` (`id`) VALUE (:service_id)"
View Source
const SqlCreateTeam = "INSERT INTO `teams` (`id`) VALUE (:team_id)"
View Source
const SqlCreateUser = "INSERT INTO `users` (`team_iid`,`id`) VALUE (:team_iid, :user_id)"
View Source
const SqlDecrementActionLinkCount = "UPDATE `action_links` SET count = count - 1 WHERE `action_iid` = :action_iid and `user_iid` = :user_iid"
support role
View Source
const SqlDeleteActionByID = "DELETE FROM `actions` WHERE `id` = :action_id and `service_iid` = :service_iid"
View Source
const SqlDeleteActionByIID = "DELETE FROM `actions` WHERE `iid` = :action_iid and `service_iid` = :service_iid"
View Source
const SqlDeleteActionLink = "DELETE FROM `action_links` WHERE `action_iid` = :action_iid and `user_iid` = :user_iid"
View Source
const SqlDeleteRoleAction = "DELETE FROM `role_actions` WHERE `action_iid` = :action_iid and `role_iid` = :role_iid"
View Source
const SqlDeleteRoleByID = "DELETE FROM `roles` WHERE `team_iid` = :team_iid and `id` = :role_id"
View Source
const SqlDeleteRoleByIID = "DELETE FROM `roles` WHERE `iid` = :role_iid"
View Source
const SqlDeleteRoleLink = "DELETE FROM `role_links` WHERE `role_iid` = :role_iid and `user_iid` = :user_iid"
View Source
const SqlDeleteServiceByID = "DELETE FROM `services` WHERE `id` = :service_id"
View Source
const SqlDeleteServiceByIID = "DELETE FROM `services` WHERE `iid` = :service_iid"
View Source
const SqlDeleteSession = "DELETE FROM `sessions` WHERE `session` = :session_id and `user_iid` = :user_iid"
View Source
const SqlDeleteTeamByID = "DELETE FROM `teams` WHERE `id` = :team_id"
View Source
const SqlDeleteTeamByIID = "DELETE FROM `teams` WHERE `iid` = :team_iid"
View Source
const SqlDeleteUserByID = "DELETE FROM `users` WHERE `team_iid` = :team_iid and `id` = :user_id"
View Source
const SqlDeleteUserByIID = "DELETE FROM `users` WHERE `iid` = :user_iid"
View Source
const SqlGetActionByID = "SELECT `iid`, `service_iid`, `id` FROM `actions` WHERE `id` = :action_id and `service_iid` = :service_iid"
View Source
const SqlGetActionLink = "SELECT `action_iid`, `user_iid`, `count` FROM `action_links` WHERE `action_iid` = :action_iid and `user_iid` = :user_iid"
View Source
const SqlGetPasswordByID = "" /* 184-byte string literal not displayed */
View Source
const SqlGetPasswordByIID = "SELECT `password` FROM `passwords` WHERE `user_iid` = :user_iid"
View Source
const SqlGetRoleActions = "SELECT `role_iid`, `action_iid` FROM `role_actions` WHERE `role_iid` = :role_iid"
View Source
const SqlGetRoleByID = "SELECT `iid`, `team_iid`, `id` FROM `roles` WHERE `team_iid` = :team_iid and `id` = :role_id"
View Source
const SqlGetServiceByID = "SELECT `iid`, `id` FROM `services` WHERE `id` = :service_id"
View Source
const SqlGetSession = "SELECT `session`, `update_date`, `user_iid` FROM `sessions` WHERE `session` = :session_id and `user_iid` = :user_iid"
View Source
const SqlGetTeamByID = "SELECT iid, id FROM `teams` WHERE `id` = :team_id"
View Source
const SqlGetUserByID = "SELECT `iid`, `team_iid`, `id` FROM `users` WHERE `team_iid` = :team_iid and `id` = :user_id"
View Source
const SqlUpsertActionLink = "" /* 126-byte string literal not displayed */
View Source
const SqlUpsertPasswordByID = SqlUpsertPasswordInsertBase + "`users`.`team_iid` = :team_iid and `users`.`id` = :user_id " + SqlUpsertPasswordUpdateBase
View Source
const SqlUpsertPasswordByIID = SqlUpsertPasswordInsertBase + "`users`.`iid` = :user_iid " + SqlUpsertPasswordUpdateBase
View Source
const SqlUpsertPasswordInsertBase = "INSERT INTO `passwords` (`user_iid`,`password`) SELECT `users`.`iid`, :password as password FROM `users` WHERE "
View Source
const SqlUpsertPasswordUpdateBase = "ON DUPLICATE KEY UPDATE `passwords`.`password` = :password"
Variables ¶
View Source
var ErrDuplicate = errors.New("duplicate")
Functions ¶
func CreateActionLink ¶
func CreateRoleAction ¶
func CreateRoleLink ¶
func DeleteActionByID ¶
func DeleteActionByIID ¶
func DeleteActionLink ¶
func DeleteRoleAction ¶
func DeleteRoleByID ¶
func DeleteRoleByIID ¶
func DeleteRoleLink ¶
func DeleteServiceByID ¶
func DeleteServiceByIID ¶
func DeleteTeamByID ¶
func DeleteTeamByIID ¶
func DeleteUserByID ¶
func DeleteUserByIID ¶
func UpsertActionLink ¶
Types ¶
type Action ¶
type Action struct { IID uint32 `db:"iid"` ServiceIID uint32 `db:"service_iid"` ID string `db:"id"` }
func CreateAction ¶
type ActionLink ¶
type ActionLink struct { ActionIID uint32 `db:"action_iid"` UserIID uint32 `db:"user_iid"` Count uint32 `db:"count"` }
func GetActionLink ¶
func GetActionLink(db gfsql.DB, action *Action, user *User) (*ActionLink, error)
func (*ActionLink) Validate ¶
func (actionLink *ActionLink) Validate() error
type RoleAction ¶
func GetRoleActions ¶
func GetRoleActions(db gfsql.DB, role *Role) ([]RoleAction, error)
type Session ¶
type Team ¶
func CreateTeam ¶
Click to show internal directories.
Click to hide internal directories.