state

package
v0.0.0-...-e31961d Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

README

State Usecase

State is useful to ensure that request is coming from the right person, to prevent a CFRS(Cross-site Request Forgery)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Usecase

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

Usecase of state

func New

func New(stateRepo stateRepository) *Usecase

New state Usecase

func (Usecase) Create

func (u Usecase) Create(ctx context.Context, data entity.State) (string, error)

Create state returning state_id and error

func (Usecase) Delete

func (u Usecase) Delete(ctx context.Context, stateid string) error

Delete state

func (Usecase) Get

func (u Usecase) Get(ctx context.Context, stateid string) (entity.State, error)

Get state

func (Usecase) SetExpire

func (u Usecase) SetExpire(ctx context.Context, stateid string, duration time.Duration) error

SetExpire for state

Jump to

Keyboard shortcuts

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