rest

package
v0.0.0-...-e55fb6d Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAccountID = echo.Map{
		"message": "invalid account id",
		"details": []string{"must be a valid uuid"},
	}

	ErrAccountNotFound = echo.Map{
		"message": "account not found",
	}

	ErrInternalServerError = echo.Map{
		"message": http.StatusText(http.StatusInternalServerError),
	}
)

Functions

func NewGoccyEchoSerializer

func NewGoccyEchoSerializer() *goccyEchoSerializer

func NewUserError

func NewUserError(msg string, details []string) echo.Map

func V1_GET_Account

func V1_GET_Account(svc AccountService) echo.HandlerFunc

func V1_POST_Account

func V1_POST_Account(svc AccountService) echo.HandlerFunc

Types

type AccountService

type AccountService interface {
	New(ctx context.Context, a account.NewAccount) (ulid.ULID, error)
	Retrieve(ctx context.Context, id string) (*account.Account, error)
}

type BulkProcessor

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

func NewBulkProcessor

func NewBulkProcessor() *BulkProcessor

func (*BulkProcessor) DoStuff

func (bp *BulkProcessor) DoStuff(c echo.Context) error

func (*BulkProcessor) FindShard

func (bp *BulkProcessor) FindShard(id uint64) (ch Shard, running bool, clean func())

type GETAccountResponse

type GETAccountResponse struct {
	ID        string          `json:"id"`
	Name      string          `json:"name"`
	Document  string          `json:"document"`
	Balance   decimal.Decimal `json:"starting_balance"`
	CreatedAt time.Time       `json:"created_at"`
	UpdateAt  time.Time       `json:"updated_at,omitempty"`
}

type POSTAccountRequest

type POSTAccountRequest struct {
	Name            string          `json:"name"`
	Document        string          `json:"document"`
	StartingBalance decimal.Decimal `json:"starting_balance"`
}

type SafeMap

type SafeMap[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewSafeMap

func NewSafeMap[K comparable, V any](size int) *SafeMap[K, V]

func (*SafeMap[K, V]) Delete

func (sm *SafeMap[K, V]) Delete(k K)

func (*SafeMap[K, V]) Get

func (sm *SafeMap[K, V]) Get(k K) (v V, ok bool)

func (*SafeMap[K, V]) GetOrSet1

func (sm *SafeMap[K, V]) GetOrSet1(k K, v V) (V, bool)

func (*SafeMap[K, V]) GetOrSet2

func (sm *SafeMap[K, V]) GetOrSet2(k K, v V) (V, bool)

func (*SafeMap[K, V]) Set

func (sm *SafeMap[K, V]) Set(k K, v V)

type ServiceLayer

type ServiceLayer interface {
	Do([]any) error
}

type Shard

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

func (Shard) BulkRequests

func (s Shard) BulkRequests(timeout time.Duration, maxSize int, fnClose func())

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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