adapter

package
v0.0.0-...-d5338d4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomerRepoImpl

type CustomerRepoImpl struct {
	*postgres.Postgres
}

func NewCustomerRepo

func NewCustomerRepo(pg *postgres.Postgres) *CustomerRepoImpl

func (*CustomerRepoImpl) CreateCustomer

func (*CustomerRepoImpl) CustomerList

func (*CustomerRepoImpl) CustomerListTotal

func (r *CustomerRepoImpl) CustomerListTotal(ctx context.Context, req customerRequest.CustomerListReq) (int, error)

func (*CustomerRepoImpl) GetCustomer

func (r *CustomerRepoImpl) GetCustomer(ctx context.Context, customerId string) (res response.CustomerRes, err error)

func (*CustomerRepoImpl) PaginationQuery

func (r *CustomerRepoImpl) PaginationQuery(ctx context.Context, builder squirrel.SelectBuilder, page customerRequest.Pagination) (pgx.Rows, error)

func (*CustomerRepoImpl) ReadApiKey

func (r *CustomerRepoImpl) ReadApiKey(ctx context.Context, customerUUID string) (res string, err error)

func (*CustomerRepoImpl) SetApiKey

func (*CustomerRepoImpl) SetDisabledStatusCustomer

func (r *CustomerRepoImpl) SetDisabledStatusCustomer(ctx context.Context, req customerRequest.SetEnabledStatusCustomer) error

func (*CustomerRepoImpl) UpdateCustomer

type GoCloakImpl

type GoCloakImpl struct {
	Token        *gocloak.JWT
	Client       gocloak.GoCloak
	ClientId     string
	UserName     string
	ClientSecret string
	Realm        string
}

func NewKeyCloak

func NewKeyCloak(ctx context.Context, config config.Config) (k *GoCloakImpl, err error)

func (*GoCloakImpl) CreateCustomer

func (k *GoCloakImpl) CreateCustomer(ctx context.Context, req customerRequest.CreateCustomerReq) (string, error)

func (*GoCloakImpl) CreateGroup

func (k *GoCloakImpl) CreateGroup(ctx context.Context, req groupRequest.CreateGroupReq) (string, error)

func (*GoCloakImpl) CreateUser

func (k *GoCloakImpl) CreateUser(ctx context.Context, req userRequest.CreateUserReq) (string, error)

func (*GoCloakImpl) DeleteUser

func (k *GoCloakImpl) DeleteUser(ctx context.Context, req userRequest.DeleteUserReq) error

func (*GoCloakImpl) GetUserInfo

func (k *GoCloakImpl) GetUserInfo(ctx context.Context, req userRequest.GetUserInfoReq) (res entity.UserInfo, err error)

func (*GoCloakImpl) SetEnabledStatusUser

func (k *GoCloakImpl) SetEnabledStatusUser(ctx context.Context, req userRequest.SetEnabledStatusUserReq) error

func (*GoCloakImpl) UpdateUser

func (k *GoCloakImpl) UpdateUser(ctx context.Context, req userRequest.UpdateUserReq) error

type GroupRepoImpl

type GroupRepoImpl struct {
	*postgres.Postgres
}

func NewGroupRepo

func NewGroupRepo(pg *postgres.Postgres) *GroupRepoImpl

func (*GroupRepoImpl) CreateGroup

func (r *GroupRepoImpl) CreateGroup(ctx context.Context, req groupRequest.CreateGroupReq) error

func (*GroupRepoImpl) GetGroup

func (r *GroupRepoImpl) GetGroup(ctx context.Context, groupId string) (res response.GroupRes, err error)

func (*GroupRepoImpl) GroupList

func (r *GroupRepoImpl) GroupList(ctx context.Context, req groupRequest.GroupListReq) (res response.GroupList, err error)

func (*GroupRepoImpl) GroupListTotal

func (r *GroupRepoImpl) GroupListTotal(ctx context.Context) (int, error)

func (*GroupRepoImpl) PaginationQuery

func (r *GroupRepoImpl) PaginationQuery(ctx context.Context, builder squirrel.SelectBuilder, page groupRequest.Pagination) (pgx.Rows, error)

func (*GroupRepoImpl) UpdateGroup

func (r *GroupRepoImpl) UpdateGroup(ctx context.Context, req groupRequest.UpdateGroupReq) error

type KeyCloak

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

type UserRepoImpl

type UserRepoImpl struct {
	*postgres.Postgres
}

func NewUserRepo

func NewUserRepo(pg *postgres.Postgres) *UserRepoImpl

func (*UserRepoImpl) CreateUser

func (r *UserRepoImpl) CreateUser(ctx context.Context, req userRequest.CreateUserReq) error

func (*UserRepoImpl) GetCustomerUUIDByUserName

func (userRepo *UserRepoImpl) GetCustomerUUIDByUserName(ctx context.Context, userName string) (customerUUID string, err error)

func (*UserRepoImpl) GetUserInfo

func (r *UserRepoImpl) GetUserInfo(ctx context.Context, req userRequest.GetUserInfoReq, requestPermission string) (res entity.UserInfo, err error)

func (*UserRepoImpl) PaginationQuery

func (r *UserRepoImpl) PaginationQuery(ctx context.Context, builder squirrel.SelectBuilder, page userRequest.Pagination) (pgx.Rows, error)

func (*UserRepoImpl) SetEnabledStatusUser

func (r *UserRepoImpl) SetEnabledStatusUser(ctx context.Context, req userRequest.SetEnabledStatusUserReq, requestPermission string) (*string, error)

SetEnabledStatusUser выполняет запрос вида

update customers.users set enabled = {req.Enabled} where user_uuid = {req.UserId} and user_uuid in (

select u.user_uuid from (
	{requestPermission}
) as u

)

func (*UserRepoImpl) UpdateUser deprecated

func (r *UserRepoImpl) UpdateUser(ctx context.Context, req userRequest.UpdateUserReq) error

Deprecated: 123

func (*UserRepoImpl) UserList

func (r *UserRepoImpl) UserList(ctx context.Context, req userRequest.UserListReq) (res entity.UserList, err error)

func (*UserRepoImpl) UserListTotal

func (r *UserRepoImpl) UserListTotal(ctx context.Context) (int, error)

Jump to

Keyboard shortcuts

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