Documentation ¶
Index ¶
- Constants
- func ActiveCategories(category *Category) bool
- func ActiveRoles(role *Role) bool
- func ActiveUsers(user *User) bool
- func ActiveVentures(venture *Venture) bool
- func AllCategories(*Category) bool
- func AllFeatureRoles(*FeatureRole) bool
- func AllFeatures(*Feature) bool
- func AllRESTfulFeatures(feature string) []string
- func AllRoles(*Role) bool
- func AllUserRoles(userRole *UserRole) bool
- func AllUsers(*User) bool
- func AllVentures(*Venture) bool
- func CommitOnSuccess(ops Operations, success *bool, afterCommit func())
- func EnsureFeatures(names []string) (err error)
- func FeatureDELETE(feature string) string
- func FeatureGET(feature string) string
- func FeaturePOST(feature string) string
- func FeaturePUT(feature string) string
- func IsAdmin(ops Operations, id int64) bool
- func RESTfulFeatures(feature string, methods ...string) []string
- func UserRolesByUser(userId int64) func(*UserRole) bool
- func UserRolesByUserAndRole(userId, roleId int64) func(*UserRole) bool
- type AccessBackend
- type Category
- type Database
- type Entry
- type Feature
- type FeatureRole
- type Operations
- type PGDatabase
- type Role
- type SQLiteDatabase
- type User
- type UserRole
- type Venture
Constants ¶
View Source
const (
DefaultDatabaseSqlite = "file::memory:?cache=shared"
)
Variables ¶
This section is empty.
Functions ¶
func AllFeatureRoles ¶
func AllFeatureRoles(*FeatureRole) bool
func CommitOnSuccess ¶
func CommitOnSuccess(ops Operations, success *bool, afterCommit func())
func IsAdmin ¶
func IsAdmin(ops Operations, id int64) bool
Types ¶
type AccessBackend ¶
type AccessBackend struct {
// contains filtered or unexported fields
}
func NewAccessBackend ¶
func NewAccessBackend() *AccessBackend
func (*AccessBackend) Invalidate ¶
func (ab *AccessBackend) Invalidate()
type Category ¶
type Database ¶
type Database interface { GetOperations() Operations Close() error }
var Backend Database
type Entry ¶
type Operations ¶
type Operations interface { Begin() error Commit() error Rollback() error CreateUser(*User) error UpdateUser(*User) error GetUsers(func(*User) bool) ([]*User, error) GetUserById(int64) (*User, error) GetUserByInitals(string) (*User, error) CreateRole(*Role) error GetRoleById(int64) (*Role, error) UpdateRole(*Role) error GetRoles(func(*Role) bool) ([]*Role, error) CreateVenture(*Venture) error GetVentureById(int64) (*Venture, error) UpdateVenture(*Venture) error GetVentures(func(*Venture) bool) ([]*Venture, error) AddUserRoleToVenture(*UserRole, sql.NullInt64) error RemoveUserRoleFromVenture(int64) error GetVentureUserRoles(func(*UserRole) bool, sql.NullInt64) ([]*UserRole, error) CreateCategory(*Category) error UpdateCategory(*Category) error GetCategoryById(id int64) (*Category, error) GetCategories(func(*Category) bool) ([]*Category, error) CreateEntry(*Entry) error UpdateEntry(*Entry) error DeleteEntry(int64) error GetEntryById(int64) (*Entry, error) GetEntriesByUserId(int64) ([]*Entry, error) GetEntriesByVentureId(int64) ([]*Entry, error) CreateFeature(*Feature) error UpdateFeature(*Feature) error DeleteFeature(int64) error GetFeatures(func(*Feature) bool) ([]*Feature, error) GetFeatureById(int64) (*Feature, error) GetFeatureByName(string) (*Feature, error) CreateFeatureRole(*FeatureRole) error UpdateFeatureRole(*FeatureRole) error DeleteFeatureRole(int64) error GetFeatureRoles(func(*FeatureRole) bool) ([]*FeatureRole, error) GetFeatureRolesByRole(func(*FeatureRole) bool, int64) ([]*FeatureRole, error) GetFeatureRoleById(int64) (*FeatureRole, error) }
type PGDatabase ¶
type PGDatabase struct {
// contains filtered or unexported fields
}
func NewPGDatabase ¶
func NewPGDatabase(dataSourceName, admPW string) (*PGDatabase, error)
func (*PGDatabase) Close ¶
func (sdb *PGDatabase) Close() error
func (*PGDatabase) GetOperations ¶
func (sdb *PGDatabase) GetOperations() Operations
type Role ¶
type SQLiteDatabase ¶
type SQLiteDatabase struct {
// contains filtered or unexported fields
}
func NewSQLiteDatabase ¶
func NewSQLiteDatabase(dataSourceName, admPW string) (*SQLiteDatabase, error)
func (*SQLiteDatabase) Close ¶
func (sdb *SQLiteDatabase) Close() error
func (*SQLiteDatabase) GetOperations ¶
func (sdb *SQLiteDatabase) GetOperations() Operations
type User ¶
Click to show internal directories.
Click to hide internal directories.