entities

package
v0.0.0-...-4bd82ba Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bank

type Bank struct {
	Name      string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func MakeBankEntity

func MakeBankEntity(
	name string,
	createdAt time.Time,
	updatedAt time.Time,
) (*Bank, error)

func (*Bank) MarshalJSON

func (b *Bank) MarshalJSON() ([]byte, error)

func (*Bank) Validate

func (b *Bank) Validate() error

type IBankListDto

type IBankListDto interface {
	Validate() error
}

func NewBankListDTO

func NewBankListDTO() IBankListDto

type JWTClaims

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

func NewJwtClaim

func NewJwtClaim(id *uuid.UUID, audiences []uuid.UUID, subject string, scopes []string) *JWTClaims

func (*JWTClaims) Generate

func (jwtClaim *JWTClaims) Generate() (*string, domainErrors.DomainError)

func (*JWTClaims) GetExpiresAt

func (jwtClaim *JWTClaims) GetExpiresAt() time.Time

func (*JWTClaims) GetJwtId

func (jwtClaim *JWTClaims) GetJwtId() uuid.UUID

func (*JWTClaims) SetId

func (jwtClaim *JWTClaims) SetId(id uuid.UUID) *JWTClaims

type OauthAccessToken

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

func CreateGrantTypeClientCredentials

func CreateGrantTypeClientCredentials(
	clientId uuid.UUID,
	scopes []string,
	expiresAt time.Time,
) (*OauthAccessToken, errors.DomainError)

func CreateOauthAccessToken

func CreateOauthAccessToken(
	userId *uuid.UUID,
	clientId uuid.UUID,
	grantType string,
	scopes []string,
	revokedAt *time.Time,
	expiresAt time.Time,
) (*OauthAccessToken, errors.DomainError)

func NewOauthAccessTokenEntity

func NewOauthAccessTokenEntity(
	id uuid.UUID,
	userId *uuid.UUID,
	grantType string,
	clientId uuid.UUID,
	scopes []string,
	expiresAt time.Time,
	createdAt time.Time,
	updatedAt time.Time,
	deletedAt *time.Time,
) (*OauthAccessToken, errors.DomainError)

func (*OauthAccessToken) ClientId

func (oauth *OauthAccessToken) ClientId() uuid.UUID

func (*OauthAccessToken) CreatedAt

func (oauth *OauthAccessToken) CreatedAt() time.Time

func (*OauthAccessToken) ExpiresAt

func (oauth *OauthAccessToken) ExpiresAt() time.Time

func (*OauthAccessToken) GrantType

func (oauth *OauthAccessToken) GrantType() string

func (*OauthAccessToken) Id

func (oauth *OauthAccessToken) Id() *uuid.UUID

func (*OauthAccessToken) RevokedAt

func (oauth *OauthAccessToken) RevokedAt() *time.Time

func (*OauthAccessToken) Scopes

func (oauth *OauthAccessToken) Scopes() []string

func (*OauthAccessToken) UpdatedAt

func (oauth *OauthAccessToken) UpdatedAt() time.Time

func (*OauthAccessToken) UserId

func (oauth *OauthAccessToken) UserId() *uuid.UUID

type OauthAuthCode

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

func CreateOauthCode

func CreateOauthCode(
	userId uuid.UUID,
	clientId uuid.UUID,
	scopes []string,
	expiresAt time.Time,
) (*OauthAuthCode, domainErrors.DomainError)

func NewOauthAuthCode

func NewOauthAuthCode(
	id uuid.UUID,
	userId uuid.UUID,
	clientId uuid.UUID,
	scopes []string,
	expiresAt time.Time,
	timestamps valueObjects.TimestampValueObject,
) *OauthAuthCode

type OauthClient

type OauthClient struct {
	ID               uuid.UUID  `json:"id"`
	Name             string     `json:"name"`
	EnabledGrantType []string   `json:"enabled_grant_type"`
	Secret           string     `json:"secret"`
	Redirect         string     `json:"redirect"`
	CreatedAt        *time.Time `json:"created_at"`
	UpdatedAt        *time.Time `json:"updated_at"`
	DeletedAt        *time.Time `json:"deleted_at"`
}

func MakeOauthClientEntity

func MakeOauthClientEntity(
	ID uuid.UUID,
	name string,
	enabledGrantType []string,
	secret string,
	redirect string,
	createdAt *time.Time,
	updatedAt *time.Time,
	deletedAt *time.Time,
) (*OauthClient, errors.DomainError)

type Token

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

func NewToken

func NewToken(
	id uuid.UUID,
	tokenType string,
	expiresIn time.Time,
	accessToken string,
	refreshToken *string,
) (*Token, domainErrors.DomainError)

func (*Token) AccessToken

func (token *Token) AccessToken() string

func (*Token) ExpiresIn

func (token *Token) ExpiresIn() time.Time

func (*Token) Id

func (token *Token) Id() uuid.UUID

func (*Token) MarshalJSON

func (token *Token) MarshalJSON() ([]byte, error)

func (*Token) RefreshToken

func (token *Token) RefreshToken() *string

func (*Token) TokenType

func (token *Token) TokenType() string

type User

type User struct {
	ID        string
	Username  string
	Password  string
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt time.Time
}

func MakeUserEntity

func MakeUserEntity(
	id,
	username,
	password string,
	createdAt,
	updatedAt,
	deletedAt time.Time,
) (*User, error)

Jump to

Keyboard shortcuts

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