account

package module
v0.0.0-...-265289d Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NRN_AccountRoles = &_AccountRoles{}

NRN_AccountRoles is the collection used to query AccountRoles model.

View Source
var NRN_Accounts = &_Accounts{}

NRN_Accounts is the collection used to query Account model.

View Source
var NRN_AuthorizeScopes = &_AuthorizeScopes{}

NRN_AuthorizeScopes is the collection used to query AuthorizeScope model.

View Source
var NRN_RoleScopes = &_RoleScopes{}

NRN_RoleScopes is the collection used to query RoleScopes model.

View Source
var NRN_Roles = &_Roles{}

NRN_Roles is the collection used to query Role model.

Neuron_Collections stores all generated collections.

View Source
var Neuron_Models = []mapping.Model{
	&Account{},
	&AccountRoles{},
	&AuthorizeScope{},
	&Role{},
	&RoleScopes{},
}

Neuron_Models stores all generated models in this package.

Functions

func StoreAccountInContext

func StoreAccountInContext(ctx context.Context, account *Account) context.Context

StoreAccountInContext stores the account in the context and returns it.

Types

type Account

type Account struct {
	ID uuid.UUID
	// Timestamps for the account.
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
	// Email is the unique
	Email string `db:"unique,notnull"`
	// HashPassword is the hash obtained by hashing the password.
	HashPassword []byte `codec:"-"`
	// Password is the user provided password.
	Password string `db:"-"`
	Roles    []*Role
}

Account is the basic model used for authentication and authorization.

func CtxGetAccount

func CtxGetAccount(ctx context.Context) (*Account, bool)

CtxGetAccount gets account from provided context.

func (*Account) AddRelationModel

func (a *Account) AddRelationModel(relation *mapping.StructField, model mapping.Model) error

AddRelationModel implements mapping.MultiRelationer interface.

func (*Account) GetFieldValue

func (a *Account) GetFieldValue(field *mapping.StructField) (interface{}, error)

GetFieldValue implements mapping.Fielder interface.

func (*Account) GetFieldZeroValue

func (a *Account) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)

GetFieldZeroValue implements mapping.Fielder interface.s

func (*Account) GetFieldsAddress

func (a *Account) GetFieldsAddress(field *mapping.StructField) (interface{}, error)

GetFieldsAddress gets the address of provided 'field'.

func (*Account) GetHashableFieldValue

func (a *Account) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)

GetHashableFieldValue implements mapping.Fielder interface.

func (*Account) GetPrimaryKeyAddress

func (a *Account) GetPrimaryKeyAddress() interface{}

GetPrimaryKeyAddress implements mapping.Model interface method.

func (*Account) GetPrimaryKeyHashableValue

func (a *Account) GetPrimaryKeyHashableValue() interface{}

GetPrimaryKeyHashableValue implements mapping.Model interface method.

func (*Account) GetPrimaryKeyStringValue

func (a *Account) GetPrimaryKeyStringValue() (string, error)

GetPrimaryKeyStringValue implements mapping.Model interface method.

func (*Account) GetPrimaryKeyValue

func (a *Account) GetPrimaryKeyValue() interface{}

GetPrimaryKeyValue implements mapping.Model interface method.

func (*Account) GetPrimaryKeyZeroValue

func (a *Account) GetPrimaryKeyZeroValue() interface{}

GetPrimaryKeyZeroValue implements mapping.Model interface method.

func (*Account) GetRelationLen

func (a *Account) GetRelationLen(relation *mapping.StructField) (int, error)

GetRelationLen implements mapping.MultiRelationer interface.

func (*Account) GetRelationModelAt

func (a *Account) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)

GetRelationModelAt implements mapping.MultiRelationer interface.

func (*Account) GetRelationModels

func (a *Account) GetRelationModels(relation *mapping.StructField) (models []mapping.Model, err error)

GetRelationModels implements mapping.MultiRelationer interface.

func (*Account) InsertValidate

func (a *Account) InsertValidate() error

Validate does the validation of the input account. It checks the email address as well as the

func (*Account) IsFieldZero

func (a *Account) IsFieldZero(field *mapping.StructField) (bool, error)

IsFieldZero implements mapping.Fielder interface.

func (*Account) IsPrimaryKeyZero

func (a *Account) IsPrimaryKeyZero() bool

IsPrimaryKeyZero implements mapping.Model interface method.

func (*Account) NeuronCollectionName

func (a *Account) NeuronCollectionName() string

NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'Account'.

func (*Account) ParseFieldsStringValue

func (a *Account) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)

SetPrimaryKeyStringValue implements mapping.Model interface method.

func (*Account) SetFieldValue

func (a *Account) SetFieldValue(field *mapping.StructField, value interface{}) (err error)

SetFieldValue implements mapping.Fielder interface.

func (*Account) SetFieldZeroValue

func (a *Account) SetFieldZeroValue(field *mapping.StructField) error

SetFieldZeroValue implements mapping.Fielder interface.s

func (*Account) SetFrom

func (a *Account) SetFrom(model mapping.Model) error

SetFrom implements FromSetter interface.

func (*Account) SetPrimaryKeyStringValue

func (a *Account) SetPrimaryKeyStringValue(value string) error

SetPrimaryKeyStringValue implements mapping.Model interface method.

func (*Account) SetPrimaryKeyValue

func (a *Account) SetPrimaryKeyValue(value interface{}) error

SetPrimaryKey implements mapping.Model interface method.

func (*Account) SetRelationModels

func (a *Account) SetRelationModels(relation *mapping.StructField, models ...mapping.Model) error

SetRelationModels implements mapping.MultiRelationer interface.

type AccountRoles

type AccountRoles struct {
	ID uuid.UUID
	// Timestamps
	CreatedAt time.Time
	DeletedAt *time.Time
	// Join Model relations.
	Role      *Role
	RoleID    uint
	Account   *Account
	AccountID uuid.UUID
}

AccountRoles is the join model for the account roles many-to-many relationship.

func (*AccountRoles) GetFieldValue

func (a *AccountRoles) GetFieldValue(field *mapping.StructField) (interface{}, error)

GetFieldValue implements mapping.Fielder interface.

func (*AccountRoles) GetFieldZeroValue

func (a *AccountRoles) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)

GetFieldZeroValue implements mapping.Fielder interface.s

func (*AccountRoles) GetFieldsAddress

func (a *AccountRoles) GetFieldsAddress(field *mapping.StructField) (interface{}, error)

GetFieldsAddress gets the address of provided 'field'.

func (*AccountRoles) GetHashableFieldValue

func (a *AccountRoles) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)

GetHashableFieldValue implements mapping.Fielder interface.

func (*AccountRoles) GetPrimaryKeyAddress

func (a *AccountRoles) GetPrimaryKeyAddress() interface{}

GetPrimaryKeyAddress implements mapping.Model interface method.

func (*AccountRoles) GetPrimaryKeyHashableValue

func (a *AccountRoles) GetPrimaryKeyHashableValue() interface{}

GetPrimaryKeyHashableValue implements mapping.Model interface method.

func (*AccountRoles) GetPrimaryKeyStringValue

func (a *AccountRoles) GetPrimaryKeyStringValue() (string, error)

GetPrimaryKeyStringValue implements mapping.Model interface method.

func (*AccountRoles) GetPrimaryKeyValue

func (a *AccountRoles) GetPrimaryKeyValue() interface{}

GetPrimaryKeyValue implements mapping.Model interface method.

func (*AccountRoles) GetPrimaryKeyZeroValue

func (a *AccountRoles) GetPrimaryKeyZeroValue() interface{}

GetPrimaryKeyZeroValue implements mapping.Model interface method.

func (*AccountRoles) GetRelationModel

func (a *AccountRoles) GetRelationModel(relation *mapping.StructField) (mapping.Model, error)

GetRelationModel implements mapping.SingleRelationer interface.

func (*AccountRoles) IsFieldZero

func (a *AccountRoles) IsFieldZero(field *mapping.StructField) (bool, error)

IsFieldZero implements mapping.Fielder interface.

func (*AccountRoles) IsPrimaryKeyZero

func (a *AccountRoles) IsPrimaryKeyZero() bool

IsPrimaryKeyZero implements mapping.Model interface method.

func (*AccountRoles) NeuronCollectionName

func (a *AccountRoles) NeuronCollectionName() string

NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'AccountRoles'.

func (*AccountRoles) ParseFieldsStringValue

func (a *AccountRoles) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)

SetPrimaryKeyStringValue implements mapping.Model interface method.

func (*AccountRoles) SetFieldValue

func (a *AccountRoles) SetFieldValue(field *mapping.StructField, value interface{}) (err error)

SetFieldValue implements mapping.Fielder interface.

func (*AccountRoles) SetFieldZeroValue

func (a *AccountRoles) SetFieldZeroValue(field *mapping.StructField) error

SetFieldZeroValue implements mapping.Fielder interface.s

func (*AccountRoles) SetFrom

func (a *AccountRoles) SetFrom(model mapping.Model) error

SetFrom implements FromSetter interface.

func (*AccountRoles) SetPrimaryKeyStringValue

func (a *AccountRoles) SetPrimaryKeyStringValue(value string) error

SetPrimaryKeyStringValue implements mapping.Model interface method.

func (*AccountRoles) SetPrimaryKeyValue

func (a *AccountRoles) SetPrimaryKeyValue(value interface{}) error

SetPrimaryKey implements mapping.Model interface method.

func (*AccountRoles) SetRelationModel

func (a *AccountRoles) SetRelationModel(relation *mapping.StructField, model mapping.Model) error

SetRelationModel implements mapping.SingleRelationer interface.

type Authenticator

type Authenticator struct {
	Options       auth.Options
	SigningMethod jwt.SigningMethod
	Parser        jwt.Parser
	// contains filtered or unexported fields
}

Authenticator is the structure that implements auth.Authenticator as well as auth.Tokener interfaces. It is used to provide full authentication process for the

func New

func New(options ...auth.Option) (*Authenticator, error)

New creates new validation error.

func (*Authenticator) Authenticate

func (a *Authenticator) Authenticate(ctx context.Context, email, password string) (accountID interface{}, err error)

Authenticate implements auth.Authenticator interface. Does the authentication using bcrypt algorihtm. Returns accountID as uuid.UUID.

func (*Authenticator) Initialize

func (a *Authenticator) Initialize(c *controller.Controller) error

Initialize implements initializer interface.

func (*Authenticator) InspectToken

func (a *Authenticator) InspectToken(token string) (interface{}, error)

InspectToken inspects given token string and returns provided claims.

func (*Authenticator) RefreshToken

func (a *Authenticator) RefreshToken(ctx context.Context, refreshToken string) (auth.Token, error)

RefreshToken generates new auth.Token based on provided refresh token.

func (*Authenticator) Token

func (a *Authenticator) Token(ctx context.Context, options ...auth.TokenOption) (auth.Token, error)

Token creates an auth.Token from provided options.

type AuthorizeScope

type AuthorizeScope struct {
	ID          uint
	CreatedAt   time.Time
	DeletedAt   *time.Time
	Name        string  `db:",index=unique"`
	Description string  `json:"omitempty"`
	Roles       []*Role `neuron:"many2many=RoleScopes;foreign=ScopeID"`
}

AuthorizeScope is a scope used for the authorization process.

func (*AuthorizeScope) AddRelationModel

func (a *AuthorizeScope) AddRelationModel(relation *mapping.StructField, model mapping.Model) error

AddRelationModel implements mapping.MultiRelationer interface.

func (*AuthorizeScope) GetFieldValue

func (a *AuthorizeScope) GetFieldValue(field *mapping.StructField) (interface{}, error)

GetFieldValue implements mapping.Fielder interface.

func (*AuthorizeScope) GetFieldZeroValue

func (a *AuthorizeScope) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)

GetFieldZeroValue implements mapping.Fielder interface.s

func (*AuthorizeScope) GetFieldsAddress

func (a *AuthorizeScope) GetFieldsAddress(field *mapping.StructField) (interface{}, error)

GetFieldsAddress gets the address of provided 'field'.

func (*AuthorizeScope) GetHashableFieldValue

func (a *AuthorizeScope) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)

GetHashableFieldValue implements mapping.Fielder interface.

func (*AuthorizeScope) GetPrimaryKeyAddress

func (a *AuthorizeScope) GetPrimaryKeyAddress() interface{}

GetPrimaryKeyAddress implements mapping.Model interface method.

func (*AuthorizeScope) GetPrimaryKeyHashableValue

func (a *AuthorizeScope) GetPrimaryKeyHashableValue() interface{}

GetPrimaryKeyHashableValue implements mapping.Model interface method.

func (*AuthorizeScope) GetPrimaryKeyStringValue

func (a *AuthorizeScope) GetPrimaryKeyStringValue() (string, error)

GetPrimaryKeyStringValue implements mapping.Model interface method.

func (*AuthorizeScope) GetPrimaryKeyValue

func (a *AuthorizeScope) GetPrimaryKeyValue() interface{}

GetPrimaryKeyValue implements mapping.Model interface method.

func (*AuthorizeScope) GetPrimaryKeyZeroValue

func (a *AuthorizeScope) GetPrimaryKeyZeroValue() interface{}

GetPrimaryKeyZeroValue implements mapping.Model interface method.

func (*AuthorizeScope) GetRelationLen

func (a *AuthorizeScope) GetRelationLen(relation *mapping.StructField) (int, error)

GetRelationLen implements mapping.MultiRelationer interface.

func (*AuthorizeScope) GetRelationModelAt

func (a *AuthorizeScope) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)

GetRelationModelAt implements mapping.MultiRelationer interface.

func (*AuthorizeScope) GetRelationModels

func (a *AuthorizeScope) GetRelationModels(relation *mapping.StructField) (models []mapping.Model, err error)

GetRelationModels implements mapping.MultiRelationer interface.

func (*AuthorizeScope) IsFieldZero

func (a *AuthorizeScope) IsFieldZero(field *mapping.StructField) (bool, error)

IsFieldZero implements mapping.Fielder interface.

func (*AuthorizeScope) IsPrimaryKeyZero

func (a *AuthorizeScope) IsPrimaryKeyZero() bool

IsPrimaryKeyZero implements mapping.Model interface method.

func (*AuthorizeScope) NeuronCollectionName

func (a *AuthorizeScope) NeuronCollectionName() string

NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'AuthorizeScope'.

func (*AuthorizeScope) ParseFieldsStringValue

func (a *AuthorizeScope) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)

SetPrimaryKeyStringValue implements mapping.Model interface method.

func (*AuthorizeScope) SetFieldValue

func (a *AuthorizeScope) SetFieldValue(field *mapping.StructField, value interface{}) (err error)

SetFieldValue implements mapping.Fielder interface.

func (*AuthorizeScope) SetFieldZeroValue

func (a *AuthorizeScope) SetFieldZeroValue(field *mapping.StructField) error

SetFieldZeroValue implements mapping.Fielder interface.s

func (*AuthorizeScope) SetFrom

func (a *AuthorizeScope) SetFrom(model mapping.Model) error

SetFrom implements FromSetter interface.

func (*AuthorizeScope) SetPrimaryKeyStringValue

func (a *AuthorizeScope) SetPrimaryKeyStringValue(value string) error

SetPrimaryKeyStringValue implements mapping.Model interface method.

func (*AuthorizeScope) SetPrimaryKeyValue

func (a *AuthorizeScope) SetPrimaryKeyValue(value interface{}) error

SetPrimaryKey implements mapping.Model interface method.

func (*AuthorizeScope) SetRelationModels

func (a *AuthorizeScope) SetRelationModels(relation *mapping.StructField, models ...mapping.Model) error

SetRelationModels implements mapping.MultiRelationer interface.

type Authorizer

type Authorizer struct {
	DB database.DB
	// contains filtered or unexported fields
}

Authorizer is an implementation of the auth.Authorizer interface. It also implements full auth.RoleAuthorizer.

func (*Authorizer) AddRole

func (a *Authorizer) AddRole(ctx context.Context, db database.DB, accountID interface{}, role string) error

AddRole implements RoleAuthorizer interface.

func (*Authorizer) Authorize

func (a *Authorizer) Authorize(ctx context.Context, accountID interface{}, scopes ...string) error

Authorize checks if the account with provided ID is allowed to use the 'resource'. Provided account must be authorized for ALL provided scopes.

func (*Authorizer) ClearRoles

func (a *Authorizer) ClearRoles(ctx context.Context, db database.DB, accountID interface{}) error

ClearRoles implements RoleAuthorizer interface.

func (*Authorizer) CreateRole

func (a *Authorizer) CreateRole(ctx context.Context, role, description string) (auth.Role, error)

CreateRole creates a new 'role' with optional 'description'.

func (*Authorizer) DeleteRole

func (a *Authorizer) DeleteRole(ctx context.Context, roleName string) error

DeleteRole implements auth.RoleAuthorizer interface.

func (*Authorizer) FindRoles

func (a *Authorizer) FindRoles(ctx context.Context, options ...auth.RoleFindOption) ([]auth.Role, error)

func (*Authorizer) GetRoles

func (a *Authorizer) GetRoles(ctx context.Context, accountID interface{}) ([]auth.Role, error)

func (*Authorizer) GrantRole

func (a *Authorizer) GrantRole(ctx context.Context, db database.DB, role, scope string) error

func (*Authorizer) Initialize

func (a *Authorizer) Initialize(c *controller.Controller) error

Initialize implements core.Initializer interface.

func (*Authorizer) RemoveRole

func (a *Authorizer) RemoveRole(ctx context.Context, db database.DB, accountID interface{}, role string) error

RemoveRole implements RoleAuthorizer interface.

func (*Authorizer) RevokeRole

func (a *Authorizer) RevokeRole(ctx context.Context, db database.DB, role, scope string) error

func (*Authorizer) SetRoles

func (a *Authorizer) SetRoles(ctx context.Context, db database.DB, accountID interface{}, roles ...string) error

type Claims

type Claims struct {
	AccountID uuid.UUID
	Email     string
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
	Roles     []string
	jwt.StandardClaims
}

Claims is the jwt claims implementation that keeps the accountID stored in given token.

type Role

type Role struct {
	ID uint
	// Timestamps
	CreatedAt time.Time
	UpdatedAt *time.Time
	DeletedAt *time.Time
	// Attributes
	Name        string `db:"index=unique"`
	Description string
	// Many2Many relations
	Accounts []*Account
	Scopes   []*AuthorizeScope `neuron:"many2many=RoleScopes;foreign=,ScopeID"`
}

Role is a simple role model for the RBAC authorization. It contains a many2many relation to Accounts.

func (*Role) AddRelationModel

func (r *Role) AddRelationModel(relation *mapping.StructField, model mapping.Model) error

AddRelationModel implements mapping.MultiRelationer interface.

func (*Role) GetFieldValue

func (r *Role) GetFieldValue(field *mapping.StructField) (interface{}, error)

GetFieldValue implements mapping.Fielder interface.

func (*Role) GetFieldZeroValue

func (r *Role) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)

GetFieldZeroValue implements mapping.Fielder interface.s

func (*Role) GetFieldsAddress

func (r *Role) GetFieldsAddress(field *mapping.StructField) (interface{}, error)

GetFieldsAddress gets the address of provided 'field'.

func (*Role) GetHashableFieldValue

func (r *Role) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)

GetHashableFieldValue implements mapping.Fielder interface.

func (*Role) GetPrimaryKeyAddress

func (r *Role) GetPrimaryKeyAddress() interface{}

GetPrimaryKeyAddress implements mapping.Model interface method.

func (*Role) GetPrimaryKeyHashableValue

func (r *Role) GetPrimaryKeyHashableValue() interface{}

GetPrimaryKeyHashableValue implements mapping.Model interface method.

func (*Role) GetPrimaryKeyStringValue

func (r *Role) GetPrimaryKeyStringValue() (string, error)

GetPrimaryKeyStringValue implements mapping.Model interface method.

func (*Role) GetPrimaryKeyValue

func (r *Role) GetPrimaryKeyValue() interface{}

GetPrimaryKeyValue implements mapping.Model interface method.

func (*Role) GetPrimaryKeyZeroValue

func (r *Role) GetPrimaryKeyZeroValue() interface{}

GetPrimaryKeyZeroValue implements mapping.Model interface method.

func (*Role) GetRelationLen

func (r *Role) GetRelationLen(relation *mapping.StructField) (int, error)

GetRelationLen implements mapping.MultiRelationer interface.

func (*Role) GetRelationModelAt

func (r *Role) GetRelationModelAt(relation *mapping.StructField, index int) (models mapping.Model, err error)

GetRelationModelAt implements mapping.MultiRelationer interface.

func (*Role) GetRelationModels

func (r *Role) GetRelationModels(relation *mapping.StructField) (models []mapping.Model, err error)

GetRelationModels implements mapping.MultiRelationer interface.

func (*Role) IsFieldZero

func (r *Role) IsFieldZero(field *mapping.StructField) (bool, error)

IsFieldZero implements mapping.Fielder interface.

func (*Role) IsPrimaryKeyZero

func (r *Role) IsPrimaryKeyZero() bool

IsPrimaryKeyZero implements mapping.Model interface method.

func (*Role) NeuronCollectionName

func (r *Role) NeuronCollectionName() string

NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'Role'.

func (*Role) ParseFieldsStringValue

func (r *Role) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)

SetPrimaryKeyStringValue implements mapping.Model interface method.

func (*Role) RoleName

func (r *Role) RoleName() string

RoleName implements auth.Role.

func (*Role) SetFieldValue

func (r *Role) SetFieldValue(field *mapping.StructField, value interface{}) (err error)

SetFieldValue implements mapping.Fielder interface.

func (*Role) SetFieldZeroValue

func (r *Role) SetFieldZeroValue(field *mapping.StructField) error

SetFieldZeroValue implements mapping.Fielder interface.s

func (*Role) SetFrom

func (r *Role) SetFrom(model mapping.Model) error

SetFrom implements FromSetter interface.

func (*Role) SetPrimaryKeyStringValue

func (r *Role) SetPrimaryKeyStringValue(value string) error

SetPrimaryKeyStringValue implements mapping.Model interface method.

func (*Role) SetPrimaryKeyValue

func (r *Role) SetPrimaryKeyValue(value interface{}) error

SetPrimaryKey implements mapping.Model interface method.

func (*Role) SetRelationModels

func (r *Role) SetRelationModels(relation *mapping.StructField, models ...mapping.Model) error

SetRelationModels implements mapping.MultiRelationer interface.

type RoleScopes

type RoleScopes struct {
	ID        uint64
	CreatedAt time.Time
	DeletedAt *time.Time
	Scope     *AuthorizeScope
	ScopeID   uint `db:",index=unique_roles,unique"`
	Role      *Role
	RoleID    uint `db:",index=unique_roles,unique"`
}

RoleScopes is a join model for the mapping roles to scopes.

func (*RoleScopes) GetFieldValue

func (r *RoleScopes) GetFieldValue(field *mapping.StructField) (interface{}, error)

GetFieldValue implements mapping.Fielder interface.

func (*RoleScopes) GetFieldZeroValue

func (r *RoleScopes) GetFieldZeroValue(field *mapping.StructField) (interface{}, error)

GetFieldZeroValue implements mapping.Fielder interface.s

func (*RoleScopes) GetFieldsAddress

func (r *RoleScopes) GetFieldsAddress(field *mapping.StructField) (interface{}, error)

GetFieldsAddress gets the address of provided 'field'.

func (*RoleScopes) GetHashableFieldValue

func (r *RoleScopes) GetHashableFieldValue(field *mapping.StructField) (interface{}, error)

GetHashableFieldValue implements mapping.Fielder interface.

func (*RoleScopes) GetPrimaryKeyAddress

func (r *RoleScopes) GetPrimaryKeyAddress() interface{}

GetPrimaryKeyAddress implements mapping.Model interface method.

func (*RoleScopes) GetPrimaryKeyHashableValue

func (r *RoleScopes) GetPrimaryKeyHashableValue() interface{}

GetPrimaryKeyHashableValue implements mapping.Model interface method.

func (*RoleScopes) GetPrimaryKeyStringValue

func (r *RoleScopes) GetPrimaryKeyStringValue() (string, error)

GetPrimaryKeyStringValue implements mapping.Model interface method.

func (*RoleScopes) GetPrimaryKeyValue

func (r *RoleScopes) GetPrimaryKeyValue() interface{}

GetPrimaryKeyValue implements mapping.Model interface method.

func (*RoleScopes) GetPrimaryKeyZeroValue

func (r *RoleScopes) GetPrimaryKeyZeroValue() interface{}

GetPrimaryKeyZeroValue implements mapping.Model interface method.

func (*RoleScopes) GetRelationModel

func (r *RoleScopes) GetRelationModel(relation *mapping.StructField) (mapping.Model, error)

GetRelationModel implements mapping.SingleRelationer interface.

func (*RoleScopes) IsFieldZero

func (r *RoleScopes) IsFieldZero(field *mapping.StructField) (bool, error)

IsFieldZero implements mapping.Fielder interface.

func (*RoleScopes) IsPrimaryKeyZero

func (r *RoleScopes) IsPrimaryKeyZero() bool

IsPrimaryKeyZero implements mapping.Model interface method.

func (*RoleScopes) NeuronCollectionName

func (r *RoleScopes) NeuronCollectionName() string

NeuronCollectionName implements mapping.Model interface method. Returns the name of the collection for the 'RoleScopes'.

func (*RoleScopes) ParseFieldsStringValue

func (r *RoleScopes) ParseFieldsStringValue(field *mapping.StructField, value string) (interface{}, error)

SetPrimaryKeyStringValue implements mapping.Model interface method.

func (*RoleScopes) SetFieldValue

func (r *RoleScopes) SetFieldValue(field *mapping.StructField, value interface{}) (err error)

SetFieldValue implements mapping.Fielder interface.

func (*RoleScopes) SetFieldZeroValue

func (r *RoleScopes) SetFieldZeroValue(field *mapping.StructField) error

SetFieldZeroValue implements mapping.Fielder interface.s

func (*RoleScopes) SetFrom

func (r *RoleScopes) SetFrom(model mapping.Model) error

SetFrom implements FromSetter interface.

func (*RoleScopes) SetPrimaryKeyStringValue

func (r *RoleScopes) SetPrimaryKeyStringValue(value string) error

SetPrimaryKeyStringValue implements mapping.Model interface method.

func (*RoleScopes) SetPrimaryKeyValue

func (r *RoleScopes) SetPrimaryKeyValue(value interface{}) error

SetPrimaryKey implements mapping.Model interface method.

func (*RoleScopes) SetRelationModel

func (r *RoleScopes) SetRelationModel(relation *mapping.StructField, model mapping.Model) error

SetRelationModel implements mapping.SingleRelationer interface.

Jump to

Keyboard shortcuts

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