application

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithTokenRepository

func WithTokenRepository(tr TokenRepository) func(*UseCases)

func WithValidator

func WithValidator(v Validator) func(*UseCases)

Types

type Command

type Command struct {
	TokenValidate TokenValidateCommand
}

type TokenRepository

type TokenRepository interface {
	GetTokenPayload(ctx context.Context, accessToken string) (*core.TokenPayload, error)
}

type TokenValidateCommand

type TokenValidateCommand interface {
	Execute(ctx context.Context, params TokenValidateParams) (uuid.UUID, error)
}

type TokenValidateCommandImpl

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

func NewTokenValidateCommand

func NewTokenValidateCommand(v Validator, tr TokenRepository) *TokenValidateCommandImpl

NewTokenValidateCommand creates a new TokenValidateCommand

func (*TokenValidateCommandImpl) Execute

Execute executes the TokenValidateCommand with the given params

type TokenValidateParams

type TokenValidateParams struct {
	AccessToken string `validate:"required"`
}

TokenValidateParams is the params for the TokenValidateCommand AccessToken is the access token to validate (required)

type UseCases

type UseCases struct {
	Command
	// contains filtered or unexported fields
}

func NewUseCases

func NewUseCases(opts ...func(*UseCases)) *UseCases

type Validator

type Validator interface {
	Validate(ctx context.Context, params interface{}) error
}

Jump to

Keyboard shortcuts

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