repository

package
Version: v0.0.0-...-fe9e027 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

func NewAuthRepository

func NewAuthRepository(db *sqlx.DB) *Auth

func (*Auth) GetUserRoleByLoginAndPassword

func (r *Auth) GetUserRoleByLoginAndPassword(ctx context.Context, user *models.User) (string, error)

func (*Auth) IsExistByLogin

func (r *Auth) IsExistByLogin(ctx context.Context, login string) bool

type AuthRepository

type AuthRepository interface {
	IsExistByLogin(ctx context.Context, login string) bool
	GetUserRoleByLoginAndPassword(ctx context.Context, user *models.User) (string, error)
}

type Data

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

func NewDataRepository

func NewDataRepository(db *sqlx.DB) *Data

func (*Data) CreateValue

func (r *Data) CreateValue(ctx context.Context, value *models.Value) error

func (*Data) DeleteValueByKey

func (r *Data) DeleteValueByKey(ctx context.Context, key string) error

func (*Data) GetValueByKey

func (r *Data) GetValueByKey(ctx context.Context, key string) (*models.Value, error)

func (*Data) IsExistByKey

func (r *Data) IsExistByKey(ctx context.Context, key string) bool

type DataRepository

type DataRepository interface {
	CreateValue(ctx context.Context, value *models.Value) error
	GetValueByKey(ctx context.Context, key string) (*models.Value, error)
	DeleteValueByKey(ctx context.Context, key string) error
	IsExistByKey(ctx context.Context, key string) bool
}

type Repositories

type Repositories struct {
	AuthRepository  AuthRepository
	TokenRepository TokenRepository
	UserRepository  UserRepository
	RoleRepository  RoleRepository
	DataRepository  DataRepository
}

func NewRepositories

func NewRepositories(db *sqlx.DB) *Repositories

type Role

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

func NewRoleRepository

func NewRoleRepository(db *sqlx.DB) *Role

func (*Role) CreateRole

func (r *Role) CreateRole(ctx context.Context, role *models.Role) error

func (*Role) DeleteByRole

func (r *Role) DeleteByRole(ctx context.Context, role string) error

func (*Role) GetPermissionsByRole

func (r *Role) GetPermissionsByRole(ctx context.Context, role string) (*models.Permissions, error)

func (*Role) IsExistByRole

func (r *Role) IsExistByRole(ctx context.Context, role string) bool

type RoleRepository

type RoleRepository interface {
	CreateRole(ctx context.Context, role *models.Role) error
	GetPermissionsByRole(ctx context.Context, role string) (*models.Permissions, error)
	IsExistByRole(ctx context.Context, role string) bool
	DeleteByRole(ctx context.Context, role string) error
}

type Token

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

func NewTokenRepository

func NewTokenRepository(db *sqlx.DB) *Token

func (*Token) Create

func (r *Token) Create(ctx context.Context, token *models.UserToken) error

func (*Token) DeleteByLogin

func (r *Token) DeleteByLogin(ctx context.Context, login string) error

func (*Token) IsExistAccessTokenByLogin

func (r *Token) IsExistAccessTokenByLogin(ctx context.Context, login string) bool

type TokenRepository

type TokenRepository interface {
	Create(ctx context.Context, token *models.UserToken) error
	IsExistAccessTokenByLogin(ctx context.Context, login string) bool
	DeleteByLogin(ctx context.Context, login string) error
}

type User

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

func NewUserRepository

func NewUserRepository(db *sqlx.DB) *User

func (*User) CreateUserByAccessToken

func (r *User) CreateUserByAccessToken(ctx context.Context, user *models.CreateUser) error

func (*User) DeleteUserByLogin

func (r *User) DeleteUserByLogin(ctx context.Context, login string) error

func (*User) UpdatePasswordByLogin

func (r *User) UpdatePasswordByLogin(ctx context.Context, user *models.User) error

type UserRepository

type UserRepository interface {
	CreateUserByAccessToken(ctx context.Context, user *models.CreateUser) error
	DeleteUserByLogin(ctx context.Context, login string) error
	UpdatePasswordByLogin(ctx context.Context, user *models.User) error
}

Jump to

Keyboard shortcuts

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