model

package
v0.0.0-...-3fb2df9 Latest Latest
Warning

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

Go to latest
Published: May 14, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Application_Create

func Application_Create(app *Application) error

Create

func Application_Delete

func Application_Delete(id int) error

/Delete

func Application_Update

func Application_Update(app *Application) error

/Update

func Group_Create

func Group_Create(grp *Group) error

func Group_Delete

func Group_Delete(id int) error

func Group_Update

func Group_Update(grp *Group) error

func Operation_Create

func Operation_Create(oper *Operation) error

func Operation_Delete

func Operation_Delete(id int) error

func Operation_Update

func Operation_Update(ope *Operation) error

func Role_Create

func Role_Create(rol *Role) error

func Role_Delete

func Role_Delete(id int) error

func Role_Update

func Role_Update(rol *Role) error

func User_Create

func User_Create(usr *User) error

func User_Delete

func User_Delete(id int) error

func User_Update

func User_Update(app *User) error

Types

type Application

type Application struct {
	Id       int    `json:"id" db:"id"`
	Name     string `json:"name" db:"name"`
	PublicId string `json:"public_id" db:"public_id"`
	Enabled  bool   `json:"enabled" db:"enabled"`
}

func Application_ByPk

func Application_ByPk(id string) Application

/ByPk

func Application_List

func Application_List() []Application

List

type Group

type Group struct {
	Id            int    `json:"id" db:"id"`
	Name          string `json:"name" db:"name"`
	ApplicationId int    `json:"application_id" db:"application_id"`
}

func Group_List

func Group_List() []Group

func Group_ListByAppId

func Group_ListByAppId(appId string) []Group

type GroupApplicationJoin

type GroupApplicationJoin struct {
	Group
	ApplicationName string `json:"application_name" db:"application_name"`
}

func Group_ByPk

func Group_ByPk(id string) GroupApplicationJoin

type GroupOperation

type GroupOperation struct {
	GroupId     int `json:"group_id" db:"group_id"`
	OperationId int `json:"operaton_id" db:"operaton_id"`
}

type NullInt64

type NullInt64 struct {
	sql.NullInt64
}

func (*NullInt64) MarshalJSON

func (s *NullInt64) MarshalJSON() ([]byte, error)

func (*NullInt64) UnmarshalJSON

func (s *NullInt64) UnmarshalJSON(data []byte) error

type NullString

type NullString struct {
	sql.NullString
}

func (*NullString) MarshalJSON

func (s *NullString) MarshalJSON() ([]byte, error)

func (*NullString) UnmarshalJSON

func (s *NullString) UnmarshalJSON(data []byte) error

type Operation

type Operation struct {
	Id            int    `json:"id" db:"id"`
	ApplicationId int    `json:"application_id" db:"application_id"`
	Code          string `json:"code" db:"code"`
	Description   string `json:"description" db:"description"`
}

func Operation_List

func Operation_List() []Operation

func Operation_ListByAppId

func Operation_ListByAppId(appId string) []Operation

type OperationApplicationJoin

type OperationApplicationJoin struct {
	Operation
	ApplicationName string `json:"application_name" db:"application_name"`
}

func Operation_ByPk

func Operation_ByPk(id string) OperationApplicationJoin

type Role

type Role struct {
	Id            int    `json:"id" db:"id"`
	ApplicationId int    `json:"application_id" db:"application_id"`
	Name          string `json:"name" db:"name"`
	Enabled       bool   `json:"enabled" db:"enabled"`
}

func Role_ByPk

func Role_ByPk(id string) Role

func Role_List

func Role_List() []Role

func Role_ListByAppId

func Role_ListByAppId(appId string) []Role

type RoleGroup

type RoleGroup struct {
	Role  int `json:"role_id" db:"role_id"`
	Group int `json:"group_id" db:"group_id"`
}

type User

type User struct {
	Id      int    `json:"id" db:"id"`
	Name    string `json:"name" db:"name"`
	ExtCode string `json:"ext_code" db:"ext_code"`
	Enabled bool   `json:"enabled" db:"enabled"`
}

func User_ByPk

func User_ByPk(id string) User

func User_List

func User_List() []User
func Role_ListByUserId(userId) []UserRole {
	var apps []Role
	_, err := dbMap.Select(&apps, "select * from roles where application_id = $1 order by id", appId)
	checkErr(err, "sql.Query Role by appId")
}

func User_ListByAppId

func User_ListByAppId(appId string) []User

type UserRole

type UserRole struct {
	Role int `json:"role_id" db:"role_id"`
	User int `json:"user_id" db:"user_id"`
}

type UserRoleAssignmentVW

type UserRoleAssignmentVW struct {
	Assigned      bool      `json:"assigned" db:"assigned"`
	User          NullInt64 `json:"user_id" db:"user_id"`
	Role          int       `json:"role_id" db:"role_id"`
	Name          string    `json:"name" db:"name"`
	ApplicationId int       `json:"application_id" db:"application_id"`
}

func Roles_ListByUserAndApp

func Roles_ListByUserAndApp(appId int, userId int) []UserRoleAssignmentVW

Jump to

Keyboard shortcuts

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