service

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

type HttpClient interface {
	Get(url string, header map[string]string) ([]byte, error)
	Post(url string, header map[string]string, body []byte) ([]byte, error)
	Delete(url string, header map[string]string) error
}

HttpClient business operations.

type Jwt

type Jwt interface {
	GetRsaKeys() *v1.RsaKeys
	GenerateToken(userUUID string, duration int64, data interface{}) (token string, refreshToken string, err error)
	IsTokenValid(tokenString string) bool
	GetPrivateKey() *rsa.PrivateKey
	GetPublicKey() *rsa.PublicKey
}

Jwt business operations.

type Media

type Media interface {
	Listen(otp v1.Otp)
}

Media business operations.

type Otp

type Otp interface {
	Store(otp v1.Otp) error
	FindByOtp(otp string) v1.Otp
	IsValid(otp string) bool
}

Otp business operations.

type Permission

type Permission interface {
	Store(permission v1.Permission) error
	Get() []v1.Permission
	Delete(permissionName string) error
}

Permission business operations.

type Resource

type Resource interface {
	Store(resource v1.Resource) error
	Get() []v1.Resource
	GetByName(name string) v1.Resource
	Delete(name string) error
}

Resource business operations.

type Role

type Role interface {
	Store(role v1.RoleDto) error
	Get() []v1.RoleDto
	GetByName(name string) v1.RoleDto
	Delete(name string) error
	Update(name string, permissions []v1.Permission, option v1.RoleUpdateOption) error
}

Role business operations.

type Token

type Token interface {
	Store(token v1.Token) error
	Delete(uid string) error
	Update(token string, refreshToken string, existingToken string) error
	GetByToken(token string) v1.Token
}

Token business operations.

type User

type User interface {
	Store(user v1.UserRegistrationDto) error
	Get() []v1.User
	GetByID(id string) v1.User
	Delete(id string) error
	GetByEmail(email string) v1.User
	GetByPhone(phone string) v1.User
	GetByOtp(otp string) v1.User
	UpdateToken(token, refreshToken, existingToken string) error
	UpdatePassword(user v1.User) error
	UpdateUserResourcePermissionDto(id string, userResourcePermissionDto v1.UserResourcePermission) error
	SendOtp(email, phone, baseUrl string) error
	AttachCompany(company v1.Company, companyId, token string) error
	InitCompany(company v1.Company) error
	UpdateStatus(id string, status enums.STATUS) error
	GetUsersByCompanyId(companyId string, status enums.STATUS) []v1.User
	GetUsersCountByCompanyId(companyId string) v1.UsersCount
}

User business operations.

type UserResourcePermission

type UserResourcePermission interface {
	GetByUserID(userID string) v1.UserResourcePermissionDto
}

UserResourcePermission business operations.

Jump to

Keyboard shortcuts

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