model

package
v0.8.13 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2016 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableUser                              = "charon.user"
	TableUserColumnConfirmationToken       = "confirmation_token"
	TableUserColumnCreatedAt               = "created_at"
	TableUserColumnCreatedBy               = "created_by"
	TableUserColumnFirstName               = "first_name"
	TableUserColumnID                      = "id"
	TableUserColumnIsActive                = "is_active"
	TableUserColumnIsConfirmed             = "is_confirmed"
	TableUserColumnIsStaff                 = "is_staff"
	TableUserColumnIsSuperuser             = "is_superuser"
	TableUserColumnLastLoginAt             = "last_login_at"
	TableUserColumnLastName                = "last_name"
	TableUserColumnPassword                = "password"
	TableUserColumnUpdatedAt               = "updated_at"
	TableUserColumnUpdatedBy               = "updated_by"
	TableUserColumnUsername                = "username"
	TableUserConstraintCreatedByForeignKey = "charon.user_created_by_fkey"
	TableUserConstraintPrimaryKey          = "charon.user_id_pkey"
	TableUserConstraintUpdatedByForeignKey = "charon.user_updated_by_fkey"
	TableUserConstraintUsernameUnique      = "charon.user_username_key"
)
View Source
const (
	TableGroup                              = "charon.group"
	TableGroupColumnCreatedAt               = "created_at"
	TableGroupColumnCreatedBy               = "created_by"
	TableGroupColumnDescription             = "description"
	TableGroupColumnID                      = "id"
	TableGroupColumnName                    = "name"
	TableGroupColumnUpdatedAt               = "updated_at"
	TableGroupColumnUpdatedBy               = "updated_by"
	TableGroupConstraintCreatedByForeignKey = "charon.group_created_by_fkey"
	TableGroupConstraintPrimaryKey          = "charon.group_id_pkey"
	TableGroupConstraintNameUnique          = "charon.group_name_key"
	TableGroupConstraintUpdatedByForeignKey = "charon.group_updated_by_fkey"
)
View Source
const (
	TablePermission                                      = "charon.permission"
	TablePermissionColumnAction                          = "action"
	TablePermissionColumnCreatedAt                       = "created_at"
	TablePermissionColumnID                              = "id"
	TablePermissionColumnModule                          = "module"
	TablePermissionColumnSubsystem                       = "subsystem"
	TablePermissionColumnUpdatedAt                       = "updated_at"
	TablePermissionConstraintPrimaryKey                  = "charon.permission_id_pkey"
	TablePermissionConstraintSubsystemModuleActionUnique = "charon.permission_subsystem_module_action_key"
)
View Source
const (
	TableUserGroups                              = "charon.user_groups"
	TableUserGroupsColumnCreatedAt               = "created_at"
	TableUserGroupsColumnCreatedBy               = "created_by"
	TableUserGroupsColumnGroupID                 = "group_id"
	TableUserGroupsColumnUpdatedAt               = "updated_at"
	TableUserGroupsColumnUpdatedBy               = "updated_by"
	TableUserGroupsColumnUserID                  = "user_id"
	TableUserGroupsConstraintCreatedByForeignKey = "charon.user_groups_created_by_fkey"
	TableUserGroupsConstraintUpdatedByForeignKey = "charon.user_groups_updated_by_fkey"
	TableUserGroupsConstraintUserIDForeignKey    = "charon.user_groups_user_id_fkey"
	TableUserGroupsConstraintGroupIDForeignKey   = "charon.user_groups_group_id_fkey"
	TableUserGroupsConstraintUserIDGroupIDUnique = "charon.user_groups_user_id_group_id_key"
)
View Source
const (
	TableGroupPermissions                                                                           = "charon.group_permissions"
	TableGroupPermissionsColumnCreatedAt                                                            = "created_at"
	TableGroupPermissionsColumnCreatedBy                                                            = "created_by"
	TableGroupPermissionsColumnGroupID                                                              = "group_id"
	TableGroupPermissionsColumnPermissionAction                                                     = "permission_action"
	TableGroupPermissionsColumnPermissionModule                                                     = "permission_module"
	TableGroupPermissionsColumnPermissionSubsystem                                                  = "permission_subsystem"
	TableGroupPermissionsColumnUpdatedAt                                                            = "updated_at"
	TableGroupPermissionsColumnUpdatedBy                                                            = "updated_by"
	TableGroupPermissionsConstraintCreatedByForeignKey                                              = "charon.group_permissions_created_by_fkey"
	TableGroupPermissionsConstraintUpdatedByForeignKey                                              = "charon.group_permissions_updated_by_fkey"
	TableGroupPermissionsConstraintGroupIDForeignKey                                                = "charon.group_permissions_group_id_fkey"
	TableGroupPermissionsConstraintPermissionSubsystemPermissionModulePermissionActionForeignKey    = "charon.group_permissions_subsystem_module_action_fkey"
	TableGroupPermissionsConstraintGroupIDPermissionSubsystemPermissionModulePermissionActionUnique = "charon.group_permissions_group_id_subsystem_module_action_key"
)
View Source
const (
	TableUserPermissions                                                                          = "charon.user_permissions"
	TableUserPermissionsColumnCreatedAt                                                           = "created_at"
	TableUserPermissionsColumnCreatedBy                                                           = "created_by"
	TableUserPermissionsColumnPermissionAction                                                    = "permission_action"
	TableUserPermissionsColumnPermissionModule                                                    = "permission_module"
	TableUserPermissionsColumnPermissionSubsystem                                                 = "permission_subsystem"
	TableUserPermissionsColumnUpdatedAt                                                           = "updated_at"
	TableUserPermissionsColumnUpdatedBy                                                           = "updated_by"
	TableUserPermissionsColumnUserID                                                              = "user_id"
	TableUserPermissionsConstraintCreatedByForeignKey                                             = "charon.user_permissions_created_by_fkey"
	TableUserPermissionsConstraintUpdatedByForeignKey                                             = "charon.user_permissions_updated_by_fkey"
	TableUserPermissionsConstraintUserIDForeignKey                                                = "charon.user_permissions_user_id_fkey"
	TableUserPermissionsConstraintPermissionSubsystemPermissionModulePermissionActionForeignKey   = "charon.user_permissions_subsystem_module_action_fkey"
	TableUserPermissionsConstraintUserIDPermissionSubsystemPermissionModulePermissionActionUnique = "charon.user_permissions_user_id_subsystem_module_action_key"
)
View Source
const SQL = `` /* 4404-byte string literal not displayed */
View Source
const (
	// UserConfirmationTokenUsed ...
	UserConfirmationTokenUsed = "!"
)

Variables

View Source
var (
	// ExternalPassword is a password that is set when external source of authentication is provided (e.g. LDAP).
	ExternalPassword = []byte("!")
)

Functions

This section is empty.

Types

type GroupCriteria

type GroupCriteria struct {
	Offset, Limit int64
	Sort          map[string]bool
	CreatedAt     *qtypes.Timestamp
	CreatedBy     *qtypes.Int64
	Description   *qtypes.String
	ID            *qtypes.Int64
	Name          *qtypes.String
	UpdatedAt     *qtypes.Timestamp
	UpdatedBy     *qtypes.Int64
}

func (*GroupCriteria) WriteComposition

func (c *GroupCriteria) WriteComposition(sel string, com *pqtgo.Composer, opt *pqtgo.CompositionOpts) (err error)

type GroupEntity

type GroupEntity struct {
	// CreatedAt ...
	CreatedAt time.Time
	// CreatedBy ...
	CreatedBy *ntypes.Int64
	// Description ...
	Description *ntypes.String
	// ID ...
	ID int64
	// Name ...
	Name string
	// UpdatedAt ...
	UpdatedAt *time.Time
	// UpdatedBy ...
	UpdatedBy *ntypes.Int64
	// Author ...
	Author *UserEntity
	// Modifier ...
	Modifier *UserEntity
	// Permissions ...
	Permissions []*PermissionEntity
	// Users ...
	Users []*UserEntity
}

func ScanGroupRows

func ScanGroupRows(rows *sql.Rows) ([]*GroupEntity, error)

func (*GroupEntity) Message

func (ge *GroupEntity) Message() (*charonrpc.Group, error)

Message maps entity into protobuf message.

func (*GroupEntity) Prop

func (e *GroupEntity) Prop(cn string) (interface{}, bool)

func (*GroupEntity) Props

func (e *GroupEntity) Props(cns ...string) ([]interface{}, error)

type GroupIterator

type GroupIterator struct {
	// contains filtered or unexported fields
}

GroupIterator is not thread safe.

func (*GroupIterator) Close

func (i *GroupIterator) Close() error

func (*GroupIterator) Columns

func (i *GroupIterator) Columns() ([]string, error)

Columns is wrapper around sql.Rows.Columns method, that also cache outpu inside iterator.

func (*GroupIterator) Ent

func (i *GroupIterator) Ent() (interface{}, error)

Ent is wrapper around Group method that makes iterator more generic.

func (*GroupIterator) Err

func (i *GroupIterator) Err() error

func (*GroupIterator) Group

func (i *GroupIterator) Group() (*GroupEntity, error)

func (*GroupIterator) Next

func (i *GroupIterator) Next() bool

type GroupPatch

type GroupPatch struct {
	CreatedAt   *time.Time
	CreatedBy   *ntypes.Int64
	Description *ntypes.String
	Name        *ntypes.String
	UpdatedAt   *time.Time
	UpdatedBy   *ntypes.Int64
}

type GroupPermissionsCriteria

type GroupPermissionsCriteria struct {
	Offset, Limit       int64
	Sort                map[string]bool
	CreatedAt           *qtypes.Timestamp
	CreatedBy           *qtypes.Int64
	GroupID             *qtypes.Int64
	PermissionAction    *qtypes.String
	PermissionModule    *qtypes.String
	PermissionSubsystem *qtypes.String
	UpdatedAt           *qtypes.Timestamp
	UpdatedBy           *qtypes.Int64
}

func (*GroupPermissionsCriteria) WriteComposition

func (c *GroupPermissionsCriteria) WriteComposition(sel string, com *pqtgo.Composer, opt *pqtgo.CompositionOpts) (err error)

type GroupPermissionsEntity

type GroupPermissionsEntity struct {
	// CreatedAt ...
	CreatedAt time.Time
	// CreatedBy ...
	CreatedBy *ntypes.Int64
	// GroupID ...
	GroupID int64
	// PermissionAction ...
	PermissionAction string
	// PermissionModule ...
	PermissionModule string
	// PermissionSubsystem ...
	PermissionSubsystem string
	// UpdatedAt ...
	UpdatedAt *time.Time
	// UpdatedBy ...
	UpdatedBy *ntypes.Int64
	// Group ...
	Group *GroupEntity
	// Author ...
	Author *UserEntity
	// Modifier ...
	Modifier *UserEntity
}

func ScanGroupPermissionsRows

func ScanGroupPermissionsRows(rows *sql.Rows) ([]*GroupPermissionsEntity, error)

func (*GroupPermissionsEntity) Prop

func (e *GroupPermissionsEntity) Prop(cn string) (interface{}, bool)

func (*GroupPermissionsEntity) Props

func (e *GroupPermissionsEntity) Props(cns ...string) ([]interface{}, error)

type GroupPermissionsIterator

type GroupPermissionsIterator struct {
	// contains filtered or unexported fields
}

GroupPermissionsIterator is not thread safe.

func (*GroupPermissionsIterator) Close

func (i *GroupPermissionsIterator) Close() error

func (*GroupPermissionsIterator) Columns

func (i *GroupPermissionsIterator) Columns() ([]string, error)

Columns is wrapper around sql.Rows.Columns method, that also cache outpu inside iterator.

func (*GroupPermissionsIterator) Ent

func (i *GroupPermissionsIterator) Ent() (interface{}, error)

Ent is wrapper around GroupPermissions method that makes iterator more generic.

func (*GroupPermissionsIterator) Err

func (*GroupPermissionsIterator) GroupPermissions

func (i *GroupPermissionsIterator) GroupPermissions() (*GroupPermissionsEntity, error)

func (*GroupPermissionsIterator) Next

func (i *GroupPermissionsIterator) Next() bool

type GroupPermissionsPatch

type GroupPermissionsPatch struct {
	CreatedAt           *time.Time
	CreatedBy           *ntypes.Int64
	GroupID             *ntypes.Int64
	PermissionAction    *ntypes.String
	PermissionModule    *ntypes.String
	PermissionSubsystem *ntypes.String
	UpdatedAt           *time.Time
	UpdatedBy           *ntypes.Int64
}

type GroupPermissionsProvider

type GroupPermissionsProvider interface {
	Insert(entity *GroupPermissionsEntity) (*GroupPermissionsEntity, error)
}

GroupPermissionsProvider ...

func NewGroupPermissionsRepository

func NewGroupPermissionsRepository(dbPool *sql.DB) GroupPermissionsProvider

NewGroupPermissionsRepository ...

type GroupPermissionsRepository

type GroupPermissionsRepository struct {
	GroupPermissionsRepositoryBase
}

GroupPermissionsRepository extends GroupPermissionsRepositoryBase

type GroupPermissionsRepositoryBase

type GroupPermissionsRepositoryBase struct {
	// contains filtered or unexported fields
}

func (*GroupPermissionsRepositoryBase) Count

func (*GroupPermissionsRepositoryBase) Find

func (*GroupPermissionsRepositoryBase) FindIter

func (*GroupPermissionsRepositoryBase) FindOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction

func (r *GroupPermissionsRepositoryBase) FindOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(groupPermissionsGroupID int64, groupPermissionsPermissionSubsystem string, groupPermissionsPermissionModule string, groupPermissionsPermissionAction string) (*GroupPermissionsEntity, error)

func (*GroupPermissionsRepositoryBase) Insert

func (*GroupPermissionsRepositoryBase) UpdateOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction

func (r *GroupPermissionsRepositoryBase) UpdateOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(groupPermissionsGroupID int64, groupPermissionsPermissionSubsystem string, groupPermissionsPermissionModule string, groupPermissionsPermissionAction string, patch *GroupPermissionsPatch) (*GroupPermissionsEntity, error)

func (*GroupPermissionsRepositoryBase) Upsert

type GroupProvider

type GroupProvider interface {
	Insert(entity *GroupEntity) (*GroupEntity, error)
	// FindByUserID retrieves all groups for user represented by given id.
	FindByUserID(int64) ([]*GroupEntity, error)
	// FindOneByID retrieves group for given id.
	FindOneByID(int64) (*GroupEntity, error)
	// find ...
	Find(c *GroupCriteria) ([]*GroupEntity, error)
	// Create ...
	Create(createdBy int64, name string, description *ntypes.String) (*GroupEntity, error)
	// updateOneByID ...
	UpdateOneByID(id, updatedBy int64, name, description *ntypes.String) (*GroupEntity, error)
	// DeleteByID ...
	DeleteOneByID(id int64) (int64, error)
	// IsGranted ...
	IsGranted(id int64, permission charon.Permission) (bool, error)
	// SetPermissions ...
	SetPermissions(id int64, permissions ...charon.Permission) (int64, int64, error)
}

GroupProvider ...

func NewGroupRepository

func NewGroupRepository(dbPool *sql.DB) GroupProvider

NewGroupRepository ...

type GroupRepository

type GroupRepository struct {
	GroupRepositoryBase
}

GroupRepository extens GroupRepositoryBase

func (*GroupRepository) Create

func (gr *GroupRepository) Create(createdBy int64, name string, description *ntypes.String) (ent *GroupEntity, err error)

Create ...

func (*GroupRepository) FindByUserID

func (gr *GroupRepository) FindByUserID(userID int64) ([]*GroupEntity, error)

FindByUserID implements GroupProvider interface.

func (*GroupRepository) IsGranted

func (gr *GroupRepository) IsGranted(id int64, p charon.Permission) (bool, error)

IsGranted ...

func (*GroupRepository) SetPermissions

func (gr *GroupRepository) SetPermissions(id int64, p ...charon.Permission) (int64, int64, error)

SetPermissions ...

func (*GroupRepository) UpdateOneByID

func (gr *GroupRepository) UpdateOneByID(id, updatedBy int64, name, description *ntypes.String) (*GroupEntity, error)

UpdateOneByID ...

type GroupRepositoryBase

type GroupRepositoryBase struct {
	// contains filtered or unexported fields
}

func (*GroupRepositoryBase) Count

func (r *GroupRepositoryBase) Count(c *GroupCriteria) (int64, error)

func (*GroupRepositoryBase) DeleteOneByID

func (r *GroupRepositoryBase) DeleteOneByID(id int64) (int64, error)

func (*GroupRepositoryBase) Find

func (*GroupRepositoryBase) FindIter

func (*GroupRepositoryBase) FindOneByID

func (r *GroupRepositoryBase) FindOneByID(id int64) (*GroupEntity, error)

func (*GroupRepositoryBase) FindOneByName

func (r *GroupRepositoryBase) FindOneByName(groupName string) (*GroupEntity, error)

func (*GroupRepositoryBase) Insert

func (*GroupRepositoryBase) UpdateOneByID

func (r *GroupRepositoryBase) UpdateOneByID(id int64, patch *GroupPatch) (*GroupEntity, error)

func (*GroupRepositoryBase) UpdateOneByName

func (r *GroupRepositoryBase) UpdateOneByName(groupName string, patch *GroupPatch) (*GroupEntity, error)

func (*GroupRepositoryBase) Upsert

func (r *GroupRepositoryBase) Upsert(e *GroupEntity, p *GroupPatch, inf ...string) (*GroupEntity, error)

type MockGroupPermissionsProvider

type MockGroupPermissionsProvider struct {
	mock.Mock
}

func (*MockGroupPermissionsProvider) Insert

Insert provides a mock function with given fields: entity

type MockGroupProvider

type MockGroupProvider struct {
	mock.Mock
}

func (*MockGroupProvider) Create

func (_m *MockGroupProvider) Create(createdBy int64, name string, description *ntypes.String) (*GroupEntity, error)

Create provides a mock function with given fields: createdBy, name, description

func (*MockGroupProvider) DeleteOneByID

func (_m *MockGroupProvider) DeleteOneByID(id int64) (int64, error)

DeleteOneByID provides a mock function with given fields: id

func (*MockGroupProvider) Find

func (_m *MockGroupProvider) Find(c *GroupCriteria) ([]*GroupEntity, error)

Find provides a mock function with given fields: c

func (*MockGroupProvider) FindByUserID

func (_m *MockGroupProvider) FindByUserID(_a0 int64) ([]*GroupEntity, error)

FindByUserID provides a mock function with given fields: _a0

func (*MockGroupProvider) FindOneByID

func (_m *MockGroupProvider) FindOneByID(_a0 int64) (*GroupEntity, error)

FindOneByID provides a mock function with given fields: _a0

func (*MockGroupProvider) Insert

func (_m *MockGroupProvider) Insert(entity *GroupEntity) (*GroupEntity, error)

Insert provides a mock function with given fields: entity

func (*MockGroupProvider) IsGranted

func (_m *MockGroupProvider) IsGranted(id int64, permission charon.Permission) (bool, error)

IsGranted provides a mock function with given fields: id, permission

func (*MockGroupProvider) SetPermissions

func (_m *MockGroupProvider) SetPermissions(id int64, permissions ...charon.Permission) (int64, int64, error)

SetPermissions provides a mock function with given fields: id, permissions

func (*MockGroupProvider) UpdateOneByID

func (_m *MockGroupProvider) UpdateOneByID(id int64, updatedBy int64, name *ntypes.String, description *ntypes.String) (*GroupEntity, error)

UpdateOneByID provides a mock function with given fields: id, updatedBy, name, description

type MockPermissionProvider

type MockPermissionProvider struct {
	mock.Mock
}

func (*MockPermissionProvider) Find

Find provides a mock function with given fields: criteria

func (*MockPermissionProvider) FindByGroupID

func (_m *MockPermissionProvider) FindByGroupID(groupID int64) ([]*PermissionEntity, error)

FindByGroupID provides a mock function with given fields: groupID

func (*MockPermissionProvider) FindByUserID

func (_m *MockPermissionProvider) FindByUserID(userID int64) ([]*PermissionEntity, error)

FindByUserID provides a mock function with given fields: userID

func (*MockPermissionProvider) FindOneByID

func (_m *MockPermissionProvider) FindOneByID(id int64) (*PermissionEntity, error)

FindOneByID provides a mock function with given fields: id

func (*MockPermissionProvider) Insert

Insert provides a mock function with given fields: entity

func (*MockPermissionProvider) Register

func (_m *MockPermissionProvider) Register(permissions charon.Permissions) (int64, int64, int64, error)

Register provides a mock function with given fields: permissions

type MockPermissionRegistry

type MockPermissionRegistry struct {
	mock.Mock
}

func (*MockPermissionRegistry) Exists

func (_m *MockPermissionRegistry) Exists(permission charon.Permission) bool

Exists provides a mock function with given fields: permission

func (*MockPermissionRegistry) Register

func (_m *MockPermissionRegistry) Register(permissions charon.Permissions) (int64, int64, int64, error)

Register provides a mock function with given fields: permissions

type MockUserGroupsProvider

type MockUserGroupsProvider struct {
	mock.Mock
}

func (*MockUserGroupsProvider) DeleteByUserID added in v0.8.4

func (_m *MockUserGroupsProvider) DeleteByUserID(id int64) (int64, error)

DeleteByUserID provides a mock function with given fields: id

func (*MockUserGroupsProvider) Exists

func (_m *MockUserGroupsProvider) Exists(userID int64, groupID int64) (bool, error)

Exists provides a mock function with given fields: userID, groupID

func (*MockUserGroupsProvider) Find

Find provides a mock function with given fields: criteria

func (*MockUserGroupsProvider) Insert

Insert provides a mock function with given fields: entity

func (*MockUserGroupsProvider) Set

func (_m *MockUserGroupsProvider) Set(userID int64, groupIDs []int64) (int64, int64, error)

Set provides a mock function with given fields: userID, groupIDs

type MockUserPermissionsProvider

type MockUserPermissionsProvider struct {
	mock.Mock
}

func (*MockUserPermissionsProvider) DeleteByUserID added in v0.8.4

func (_m *MockUserPermissionsProvider) DeleteByUserID(id int64) (int64, error)

DeleteByUserID provides a mock function with given fields: id

func (*MockUserPermissionsProvider) Insert

Insert provides a mock function with given fields: entity

type MockUserProvider

type MockUserProvider struct {
	mock.Mock
}

func (*MockUserProvider) ChangePassword

func (_m *MockUserProvider) ChangePassword(id int64, password string) error

ChangePassword provides a mock function with given fields: id, password

func (*MockUserProvider) Count

func (_m *MockUserProvider) Count() (int64, error)

Count provides a mock function with given fields:

func (*MockUserProvider) Create

func (_m *MockUserProvider) Create(username string, password []byte, FirstName string, LastName string, confirmationToken []byte, isSuperuser bool, IsStaff bool, isActive bool, isConfirmed bool) (*UserEntity, error)

Create provides a mock function with given fields: username, password, FirstName, LastName, confirmationToken, isSuperuser, IsStaff, isActive, isConfirmed

func (*MockUserProvider) CreateSuperuser

func (_m *MockUserProvider) CreateSuperuser(username string, password []byte, FirstName string, LastName string) (*UserEntity, error)

CreateSuperuser provides a mock function with given fields: username, password, FirstName, LastName

func (*MockUserProvider) DeleteOneByID

func (_m *MockUserProvider) DeleteOneByID(id int64) (int64, error)

DeleteOneByID provides a mock function with given fields: id

func (*MockUserProvider) Exists

func (_m *MockUserProvider) Exists(id int64) (bool, error)

Exists provides a mock function with given fields: id

func (*MockUserProvider) Find

func (_m *MockUserProvider) Find(criteria *UserCriteria) ([]*UserEntity, error)

Find provides a mock function with given fields: criteria

func (*MockUserProvider) FindOneByID

func (_m *MockUserProvider) FindOneByID(id int64) (*UserEntity, error)

FindOneByID provides a mock function with given fields: id

func (*MockUserProvider) FindOneByUsername

func (_m *MockUserProvider) FindOneByUsername(username string) (*UserEntity, error)

FindOneByUsername provides a mock function with given fields: username

func (*MockUserProvider) Insert

func (_m *MockUserProvider) Insert(_a0 *UserEntity) (*UserEntity, error)

Insert provides a mock function with given fields: _a0

func (*MockUserProvider) IsGranted

func (_m *MockUserProvider) IsGranted(id int64, permission charon.Permission) (bool, error)

IsGranted provides a mock function with given fields: id, permission

func (*MockUserProvider) RegistrationConfirmation

func (_m *MockUserProvider) RegistrationConfirmation(id int64, confirmationToken string) error

RegistrationConfirmation provides a mock function with given fields: id, confirmationToken

func (*MockUserProvider) SetPermissions

func (_m *MockUserProvider) SetPermissions(id int64, permissions ...charon.Permission) (int64, int64, error)

SetPermissions provides a mock function with given fields: id, permissions

func (*MockUserProvider) UpdateLastLoginAt

func (_m *MockUserProvider) UpdateLastLoginAt(id int64) (int64, error)

UpdateLastLoginAt provides a mock function with given fields: id

func (*MockUserProvider) UpdateOneByID

func (_m *MockUserProvider) UpdateOneByID(_a0 int64, _a1 *UserPatch) (*UserEntity, error)

UpdateOneByID provides a mock function with given fields: _a0, _a1

type PermissionCriteria

type PermissionCriteria struct {
	Offset, Limit int64
	Sort          map[string]bool
	Action        *qtypes.String
	CreatedAt     *qtypes.Timestamp
	ID            *qtypes.Int64
	Module        *qtypes.String
	Subsystem     *qtypes.String
	UpdatedAt     *qtypes.Timestamp
}

func (*PermissionCriteria) WriteComposition

func (c *PermissionCriteria) WriteComposition(sel string, com *pqtgo.Composer, opt *pqtgo.CompositionOpts) (err error)

type PermissionEntity

type PermissionEntity struct {
	// Action ...
	Action string
	// CreatedAt ...
	CreatedAt time.Time
	// ID ...
	ID int64
	// Module ...
	Module string
	// Subsystem ...
	Subsystem string
	// UpdatedAt ...
	UpdatedAt *time.Time
	// Groups ...
	Groups []*GroupEntity
	// Users ...
	Users []*UserEntity
}

func ScanPermissionRows

func ScanPermissionRows(rows *sql.Rows) ([]*PermissionEntity, error)

func (*PermissionEntity) Permission

func (pe *PermissionEntity) Permission() charon.Permission

Permission returns charon.Permission value that is concatenated using entity properties like subsystem, module and action.

func (*PermissionEntity) Prop

func (e *PermissionEntity) Prop(cn string) (interface{}, bool)

func (*PermissionEntity) Props

func (e *PermissionEntity) Props(cns ...string) ([]interface{}, error)

type PermissionIterator

type PermissionIterator struct {
	// contains filtered or unexported fields
}

PermissionIterator is not thread safe.

func (*PermissionIterator) Close

func (i *PermissionIterator) Close() error

func (*PermissionIterator) Columns

func (i *PermissionIterator) Columns() ([]string, error)

Columns is wrapper around sql.Rows.Columns method, that also cache outpu inside iterator.

func (*PermissionIterator) Ent

func (i *PermissionIterator) Ent() (interface{}, error)

Ent is wrapper around Permission method that makes iterator more generic.

func (*PermissionIterator) Err

func (i *PermissionIterator) Err() error

func (*PermissionIterator) Next

func (i *PermissionIterator) Next() bool

func (*PermissionIterator) Permission

func (i *PermissionIterator) Permission() (*PermissionEntity, error)

type PermissionPatch

type PermissionPatch struct {
	Action    *ntypes.String
	CreatedAt *time.Time
	Module    *ntypes.String
	Subsystem *ntypes.String
	UpdatedAt *time.Time
}

type PermissionProvider

type PermissionProvider interface {
	Find(criteria *PermissionCriteria) ([]*PermissionEntity, error)
	FindOneByID(id int64) (entity *PermissionEntity, err error)
	// FindByUserID retrieves all permissions for user represented by given id.
	FindByUserID(userID int64) (entities []*PermissionEntity, err error)
	// FindByGroupID retrieves all permissions for group represented by given id.
	FindByGroupID(groupID int64) (entities []*PermissionEntity, err error)
	Register(permissions charon.Permissions) (created, untouched, removed int64, err error)
	Insert(entity *PermissionEntity) (*PermissionEntity, error)
}

PermissionProvider ...

type PermissionReg

type PermissionReg struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

PermissionReg ...

func NewPermissionRegistry

func NewPermissionRegistry(r PermissionProvider) *PermissionReg

NewPermissionRegistry ...

func (*PermissionReg) Exists

func (pr *PermissionReg) Exists(permission charon.Permission) (ok bool)

Exists ...

func (*PermissionReg) Register

func (pr *PermissionReg) Register(permissions charon.Permissions) (created, untouched, removed int64, err error)

Register ...

type PermissionRegistry

type PermissionRegistry interface {
	// Exists returns true if given charon.Permission was already registered.
	Exists(permission charon.Permission) (exists bool)
	// Register checks if given collection is valid and
	// calls PermissionProvider to store provided permissions
	// in persistent way.
	Register(permissions charon.Permissions) (created, untouched, removed int64, err error)
}

PermissionRegistry is an interface that describes in memory storage that holds information about permissions that was registered by 3rd party services. Should be only used as a proxy for registration process to avoid multiple sql hits.

type PermissionRepository

type PermissionRepository struct {
	PermissionRepositoryBase
	// contains filtered or unexported fields
}

PermissionRepository extends PermissionRepositoryBase

func NewPermissionRepository

func NewPermissionRepository(dbPool *sql.DB) *PermissionRepository

NewPermissionRepository ...

func (*PermissionRepository) FindBy

func (pr *PermissionRepository) FindBy(query string, args ...interface{}) ([]*PermissionEntity, error)

FindBy ...

func (*PermissionRepository) FindByGroupID

func (pr *PermissionRepository) FindByGroupID(userID int64) ([]*PermissionEntity, error)

FindByGroupID implements PermissionProvider interface.

func (*PermissionRepository) FindByTag

func (pr *PermissionRepository) FindByTag(userID int64) ([]*PermissionEntity, error)

FindByTag ...

func (*PermissionRepository) FindByUserID

func (pr *PermissionRepository) FindByUserID(userID int64) ([]*PermissionEntity, error)

FindByUserID implements PermissionProvider interface.

func (*PermissionRepository) Register

func (pr *PermissionRepository) Register(permissions charon.Permissions) (created, unt, removed int64, err error)

Register ...

type PermissionRepositoryBase

type PermissionRepositoryBase struct {
	// contains filtered or unexported fields
}

func (*PermissionRepositoryBase) Count

func (*PermissionRepositoryBase) DeleteOneByID

func (r *PermissionRepositoryBase) DeleteOneByID(id int64) (int64, error)

func (*PermissionRepositoryBase) Find

func (*PermissionRepositoryBase) FindIter

func (*PermissionRepositoryBase) FindOneByID

func (r *PermissionRepositoryBase) FindOneByID(id int64) (*PermissionEntity, error)

func (*PermissionRepositoryBase) FindOneBySubsystemAndModuleAndAction

func (r *PermissionRepositoryBase) FindOneBySubsystemAndModuleAndAction(permissionSubsystem string, permissionModule string, permissionAction string) (*PermissionEntity, error)

func (*PermissionRepositoryBase) Insert

func (*PermissionRepositoryBase) UpdateOneByID

func (r *PermissionRepositoryBase) UpdateOneByID(id int64, patch *PermissionPatch) (*PermissionEntity, error)

func (*PermissionRepositoryBase) UpdateOneBySubsystemAndModuleAndAction

func (r *PermissionRepositoryBase) UpdateOneBySubsystemAndModuleAndAction(permissionSubsystem string, permissionModule string, permissionAction string, patch *PermissionPatch) (*PermissionEntity, error)

func (*PermissionRepositoryBase) Upsert

type UserCriteria

type UserCriteria struct {
	Offset, Limit     int64
	Sort              map[string]bool
	ConfirmationToken []byte
	CreatedAt         *qtypes.Timestamp
	CreatedBy         *qtypes.Int64
	FirstName         *qtypes.String
	ID                *qtypes.Int64
	IsActive          *ntypes.Bool
	IsConfirmed       *ntypes.Bool
	IsStaff           *ntypes.Bool
	IsSuperuser       *ntypes.Bool
	LastLoginAt       *qtypes.Timestamp
	LastName          *qtypes.String
	Password          []byte
	UpdatedAt         *qtypes.Timestamp
	UpdatedBy         *qtypes.Int64
	Username          *qtypes.String
}

func (*UserCriteria) WriteComposition

func (c *UserCriteria) WriteComposition(sel string, com *pqtgo.Composer, opt *pqtgo.CompositionOpts) (err error)

type UserEntity

type UserEntity struct {
	// ConfirmationToken ...
	ConfirmationToken []byte
	// CreatedAt ...
	CreatedAt time.Time
	// CreatedBy ...
	CreatedBy *ntypes.Int64
	// FirstName ...
	FirstName string
	// ID ...
	ID int64
	// IsActive ...
	IsActive bool
	// IsConfirmed ...
	IsConfirmed bool
	// IsStaff ...
	IsStaff bool
	// IsSuperuser ...
	IsSuperuser bool
	// LastLoginAt ...
	LastLoginAt *time.Time
	// LastName ...
	LastName string
	// Password ...
	Password []byte
	// UpdatedAt ...
	UpdatedAt *time.Time
	// UpdatedBy ...
	UpdatedBy *ntypes.Int64
	// Username ...
	Username string
	// Author ...
	Author *UserEntity
	// Modifier ...
	Modifier *UserEntity
	// Permissions ...
	Permissions []*PermissionEntity
	// Groups ...
	Groups []*GroupEntity
}

func ScanUserRows

func ScanUserRows(rows *sql.Rows) ([]*UserEntity, error)

func (*UserEntity) Message

func (ue *UserEntity) Message() (*charonrpc.User, error)

Message maps entity into protobuf message.

func (*UserEntity) Prop

func (e *UserEntity) Prop(cn string) (interface{}, bool)

func (*UserEntity) Props

func (e *UserEntity) Props(cns ...string) ([]interface{}, error)

func (*UserEntity) String

func (ue *UserEntity) String() string

String return concatenated first and last name of the user. Implements fmt Stringer interface.

type UserGroupsCriteria

type UserGroupsCriteria struct {
	Offset, Limit int64
	Sort          map[string]bool
	CreatedAt     *qtypes.Timestamp
	CreatedBy     *qtypes.Int64
	GroupID       *qtypes.Int64
	UpdatedAt     *qtypes.Timestamp
	UpdatedBy     *qtypes.Int64
	UserID        *qtypes.Int64
}

func (*UserGroupsCriteria) WriteComposition

func (c *UserGroupsCriteria) WriteComposition(sel string, com *pqtgo.Composer, opt *pqtgo.CompositionOpts) (err error)

type UserGroupsEntity

type UserGroupsEntity struct {
	// CreatedAt ...
	CreatedAt time.Time
	// CreatedBy ...
	CreatedBy *ntypes.Int64
	// GroupID ...
	GroupID int64
	// UpdatedAt ...
	UpdatedAt *time.Time
	// UpdatedBy ...
	UpdatedBy *ntypes.Int64
	// UserID ...
	UserID int64
	// User ...
	User *UserEntity
	// Group ...
	Group *GroupEntity
	// Author ...
	Author *UserEntity
	// Modifier ...
	Modifier *UserEntity
}

func ScanUserGroupsRows

func ScanUserGroupsRows(rows *sql.Rows) ([]*UserGroupsEntity, error)

func (*UserGroupsEntity) Prop

func (e *UserGroupsEntity) Prop(cn string) (interface{}, bool)

func (*UserGroupsEntity) Props

func (e *UserGroupsEntity) Props(cns ...string) ([]interface{}, error)

type UserGroupsIterator

type UserGroupsIterator struct {
	// contains filtered or unexported fields
}

UserGroupsIterator is not thread safe.

func (*UserGroupsIterator) Close

func (i *UserGroupsIterator) Close() error

func (*UserGroupsIterator) Columns

func (i *UserGroupsIterator) Columns() ([]string, error)

Columns is wrapper around sql.Rows.Columns method, that also cache outpu inside iterator.

func (*UserGroupsIterator) Ent

func (i *UserGroupsIterator) Ent() (interface{}, error)

Ent is wrapper around UserGroups method that makes iterator more generic.

func (*UserGroupsIterator) Err

func (i *UserGroupsIterator) Err() error

func (*UserGroupsIterator) Next

func (i *UserGroupsIterator) Next() bool

func (*UserGroupsIterator) UserGroups

func (i *UserGroupsIterator) UserGroups() (*UserGroupsEntity, error)

type UserGroupsPatch

type UserGroupsPatch struct {
	CreatedAt *time.Time
	CreatedBy *ntypes.Int64
	GroupID   *ntypes.Int64
	UpdatedAt *time.Time
	UpdatedBy *ntypes.Int64
	UserID    *ntypes.Int64
}

type UserGroupsProvider

type UserGroupsProvider interface {
	Insert(entity *UserGroupsEntity) (*UserGroupsEntity, error)
	Exists(userID, groupID int64) (bool, error)
	Find(criteria *UserGroupsCriteria) ([]*UserGroupsEntity, error)
	Set(userID int64, groupIDs []int64) (int64, int64, error)
	DeleteByUserID(id int64) (int64, error)
}

UserGroupsProvider ...

func NewUserGroupsRepository

func NewUserGroupsRepository(dbPool *sql.DB) UserGroupsProvider

NewUserGroupsRepository ...

type UserGroupsRepository

type UserGroupsRepository struct {
	UserGroupsRepositoryBase
	// contains filtered or unexported fields
}

UserGroupsRepository ...

func (*UserGroupsRepository) DeleteByUserID added in v0.8.4

func (ugr *UserGroupsRepository) DeleteByUserID(id int64) (int64, error)

DeleteByUserID removes user from all groups he belongs to.

func (*UserGroupsRepository) Exists

func (ugr *UserGroupsRepository) Exists(userID, groupID int64) (bool, error)

Exists implements UserGroupsProvider interface.

func (*UserGroupsRepository) Set

func (ugr *UserGroupsRepository) Set(userID int64, groupIDs []int64) (int64, int64, error)

Set implements UserGroupsProvider interface.

type UserGroupsRepositoryBase

type UserGroupsRepositoryBase struct {
	// contains filtered or unexported fields
}

func (*UserGroupsRepositoryBase) Count

func (*UserGroupsRepositoryBase) Find

func (*UserGroupsRepositoryBase) FindIter

func (*UserGroupsRepositoryBase) FindOneByUserIDAndGroupID

func (r *UserGroupsRepositoryBase) FindOneByUserIDAndGroupID(userGroupsUserID int64, userGroupsGroupID int64) (*UserGroupsEntity, error)

func (*UserGroupsRepositoryBase) Insert

func (*UserGroupsRepositoryBase) UpdateOneByUserIDAndGroupID

func (r *UserGroupsRepositoryBase) UpdateOneByUserIDAndGroupID(userGroupsUserID int64, userGroupsGroupID int64, patch *UserGroupsPatch) (*UserGroupsEntity, error)

func (*UserGroupsRepositoryBase) Upsert

type UserIterator

type UserIterator struct {
	// contains filtered or unexported fields
}

UserIterator is not thread safe.

func (*UserIterator) Close

func (i *UserIterator) Close() error

func (*UserIterator) Columns

func (i *UserIterator) Columns() ([]string, error)

Columns is wrapper around sql.Rows.Columns method, that also cache outpu inside iterator.

func (*UserIterator) Ent

func (i *UserIterator) Ent() (interface{}, error)

Ent is wrapper around User method that makes iterator more generic.

func (*UserIterator) Err

func (i *UserIterator) Err() error

func (*UserIterator) Next

func (i *UserIterator) Next() bool

func (*UserIterator) User

func (i *UserIterator) User() (*UserEntity, error)

type UserPatch

type UserPatch struct {
	ConfirmationToken []byte
	CreatedAt         *time.Time
	CreatedBy         *ntypes.Int64
	FirstName         *ntypes.String
	IsActive          *ntypes.Bool
	IsConfirmed       *ntypes.Bool
	IsStaff           *ntypes.Bool
	IsSuperuser       *ntypes.Bool
	LastLoginAt       *time.Time
	LastName          *ntypes.String
	Password          []byte
	UpdatedAt         *time.Time
	UpdatedBy         *ntypes.Int64
	Username          *ntypes.String
}

type UserPermissionsCriteria

type UserPermissionsCriteria struct {
	Offset, Limit       int64
	Sort                map[string]bool
	CreatedAt           *qtypes.Timestamp
	CreatedBy           *qtypes.Int64
	PermissionAction    *qtypes.String
	PermissionModule    *qtypes.String
	PermissionSubsystem *qtypes.String
	UpdatedAt           *qtypes.Timestamp
	UpdatedBy           *qtypes.Int64
	UserID              *qtypes.Int64
}

func (*UserPermissionsCriteria) WriteComposition

func (c *UserPermissionsCriteria) WriteComposition(sel string, com *pqtgo.Composer, opt *pqtgo.CompositionOpts) (err error)

type UserPermissionsEntity

type UserPermissionsEntity struct {
	// CreatedAt ...
	CreatedAt time.Time
	// CreatedBy ...
	CreatedBy *ntypes.Int64
	// PermissionAction ...
	PermissionAction string
	// PermissionModule ...
	PermissionModule string
	// PermissionSubsystem ...
	PermissionSubsystem string
	// UpdatedAt ...
	UpdatedAt *time.Time
	// UpdatedBy ...
	UpdatedBy *ntypes.Int64
	// UserID ...
	UserID int64
	// User ...
	User *UserEntity
	// Author ...
	Author *UserEntity
	// Modifier ...
	Modifier *UserEntity
}

func ScanUserPermissionsRows

func ScanUserPermissionsRows(rows *sql.Rows) ([]*UserPermissionsEntity, error)

func (*UserPermissionsEntity) Prop

func (e *UserPermissionsEntity) Prop(cn string) (interface{}, bool)

func (*UserPermissionsEntity) Props

func (e *UserPermissionsEntity) Props(cns ...string) ([]interface{}, error)

type UserPermissionsIterator

type UserPermissionsIterator struct {
	// contains filtered or unexported fields
}

UserPermissionsIterator is not thread safe.

func (*UserPermissionsIterator) Close

func (i *UserPermissionsIterator) Close() error

func (*UserPermissionsIterator) Columns

func (i *UserPermissionsIterator) Columns() ([]string, error)

Columns is wrapper around sql.Rows.Columns method, that also cache outpu inside iterator.

func (*UserPermissionsIterator) Ent

func (i *UserPermissionsIterator) Ent() (interface{}, error)

Ent is wrapper around UserPermissions method that makes iterator more generic.

func (*UserPermissionsIterator) Err

func (i *UserPermissionsIterator) Err() error

func (*UserPermissionsIterator) Next

func (i *UserPermissionsIterator) Next() bool

func (*UserPermissionsIterator) UserPermissions

func (i *UserPermissionsIterator) UserPermissions() (*UserPermissionsEntity, error)

type UserPermissionsPatch

type UserPermissionsPatch struct {
	CreatedAt           *time.Time
	CreatedBy           *ntypes.Int64
	PermissionAction    *ntypes.String
	PermissionModule    *ntypes.String
	PermissionSubsystem *ntypes.String
	UpdatedAt           *time.Time
	UpdatedBy           *ntypes.Int64
	UserID              *ntypes.Int64
}

type UserPermissionsProvider

type UserPermissionsProvider interface {
	Insert(entity *UserPermissionsEntity) (*UserPermissionsEntity, error)
	DeleteByUserID(id int64) (int64, error)
}

UserPermissionsProvider ...

func NewUserPermissionsRepository

func NewUserPermissionsRepository(dbPool *sql.DB) UserPermissionsProvider

NewUserPermissionsRepository ...

type UserPermissionsRepository

type UserPermissionsRepository struct {
	UserPermissionsRepositoryBase
	// contains filtered or unexported fields
}

UserPermissionsRepository extends UserPermissionsRepositoryBase

func (*UserPermissionsRepository) DeleteByUserID added in v0.8.4

func (upr *UserPermissionsRepository) DeleteByUserID(id int64) (int64, error)

DeleteByUserID removes all permissions of given user.

type UserPermissionsRepositoryBase

type UserPermissionsRepositoryBase struct {
	// contains filtered or unexported fields
}

func (*UserPermissionsRepositoryBase) Count

func (*UserPermissionsRepositoryBase) Find

func (*UserPermissionsRepositoryBase) FindIter

func (*UserPermissionsRepositoryBase) FindOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction

func (r *UserPermissionsRepositoryBase) FindOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(userPermissionsUserID int64, userPermissionsPermissionSubsystem string, userPermissionsPermissionModule string, userPermissionsPermissionAction string) (*UserPermissionsEntity, error)

func (*UserPermissionsRepositoryBase) Insert

func (*UserPermissionsRepositoryBase) UpdateOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction

func (r *UserPermissionsRepositoryBase) UpdateOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(userPermissionsUserID int64, userPermissionsPermissionSubsystem string, userPermissionsPermissionModule string, userPermissionsPermissionAction string, patch *UserPermissionsPatch) (*UserPermissionsEntity, error)

func (*UserPermissionsRepositoryBase) Upsert

type UserProvider

type UserProvider interface {
	Exists(id int64) (bool, error)
	Create(username string, password []byte, FirstName, LastName string, confirmationToken []byte, isSuperuser, IsStaff, isActive, isConfirmed bool) (*UserEntity, error)
	Insert(*UserEntity) (*UserEntity, error)
	CreateSuperuser(username string, password []byte, FirstName, LastName string) (*UserEntity, error)
	// Count retrieves number of all users.
	Count() (int64, error)
	UpdateLastLoginAt(id int64) (int64, error)
	ChangePassword(id int64, password string) error
	Find(criteria *UserCriteria) ([]*UserEntity, error)
	FindOneByID(id int64) (*UserEntity, error)
	FindOneByUsername(username string) (*UserEntity, error)
	DeleteOneByID(id int64) (int64, error)
	UpdateOneByID(int64, *UserPatch) (*UserEntity, error)
	RegistrationConfirmation(id int64, confirmationToken string) error
	IsGranted(id int64, permission charon.Permission) (bool, error)
	SetPermissions(id int64, permissions ...charon.Permission) (int64, int64, error)
}

UserProvider wraps UserRepository into interface.

type UserRepository

type UserRepository struct {
	UserRepositoryBase
}

UserRepository extends UserRepositoryBase.

func NewUserRepository

func NewUserRepository(dbPool *sql.DB) *UserRepository

NewUserRepository alocates new UserRepository instance

func (*UserRepository) ChangePassword

func (ur *UserRepository) ChangePassword(userID int64, password string) error

ChangePassword ...

func (*UserRepository) Count

func (ur *UserRepository) Count() (n int64, err error)

Count implements UserProvider interface.

func (*UserRepository) Create

func (ur *UserRepository) Create(username string, password []byte, firstName, lastName string, confirmationToken []byte, isSuperuser, isStaff, isActive, isConfirmed bool) (*UserEntity, error)

Create implements UserProvider interface.

func (*UserRepository) CreateSuperuser

func (ur *UserRepository) CreateSuperuser(username string, password []byte, FirstName, LastName string) (*UserEntity, error)

CreateSuperuser implements UserProvider interface.

func (*UserRepository) Exists

func (ur *UserRepository) Exists(userID int64) (bool, error)

Exists implements UserProvider interface.

func (*UserRepository) FindOneBy

func (ur *UserRepository) FindOneBy(fieldName string, value interface{}) (*UserEntity, error)

FindOneBy ...

func (*UserRepository) FindOneByUsername

func (ur *UserRepository) FindOneByUsername(username string) (*UserEntity, error)

FindOneByUsername ...

func (*UserRepository) IsGranted

func (ur *UserRepository) IsGranted(id int64, p charon.Permission) (bool, error)

IsGranted implements UserProvider interface.

func (*UserRepository) RegistrationConfirmation

func (ur *UserRepository) RegistrationConfirmation(userID int64, confirmationToken string) error

RegistrationConfirmation ...

func (*UserRepository) SetPermissions

func (ur *UserRepository) SetPermissions(id int64, p ...charon.Permission) (int64, int64, error)

SetPermissions implements UserProvider interface.

func (*UserRepository) UpdateLastLoginAt

func (ur *UserRepository) UpdateLastLoginAt(userID int64) (int64, error)

UpdateLastLoginAt implements UserProvider interface.

type UserRepositoryBase

type UserRepositoryBase struct {
	// contains filtered or unexported fields
}

func (*UserRepositoryBase) Count

func (r *UserRepositoryBase) Count(c *UserCriteria) (int64, error)

func (*UserRepositoryBase) DeleteOneByID

func (r *UserRepositoryBase) DeleteOneByID(id int64) (int64, error)

func (*UserRepositoryBase) Find

func (r *UserRepositoryBase) Find(c *UserCriteria) ([]*UserEntity, error)

func (*UserRepositoryBase) FindIter

func (r *UserRepositoryBase) FindIter(c *UserCriteria) (*UserIterator, error)

func (*UserRepositoryBase) FindOneByID

func (r *UserRepositoryBase) FindOneByID(id int64) (*UserEntity, error)

func (*UserRepositoryBase) FindOneByUsername

func (r *UserRepositoryBase) FindOneByUsername(userUsername string) (*UserEntity, error)

func (*UserRepositoryBase) Insert

func (r *UserRepositoryBase) Insert(e *UserEntity) (*UserEntity, error)

func (*UserRepositoryBase) UpdateOneByID

func (r *UserRepositoryBase) UpdateOneByID(id int64, patch *UserPatch) (*UserEntity, error)

func (*UserRepositoryBase) UpdateOneByUsername

func (r *UserRepositoryBase) UpdateOneByUsername(userUsername string, patch *UserPatch) (*UserEntity, error)

func (*UserRepositoryBase) Upsert

func (r *UserRepositoryBase) Upsert(e *UserEntity, p *UserPatch, inf ...string) (*UserEntity, error)

Jump to

Keyboard shortcuts

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