entity

package
v0.0.0-...-ac819ea Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateID

func GenerateID() string

GenerateID generates a unique ID that can be used as an identifier for an entity.

Types

type ElasticTrxHistory

type ElasticTrxHistory struct {
	ID      int       `json:"id" bson:"id" msgpack:"id"`
	Created time.Time `json:"created" bson:"created" msgpack:"created"`
}

func (*ElasticTrxHistory) TableName

func (m *ElasticTrxHistory) TableName() string

type InputGet

type InputGet struct {
	Filter map[string]interface{} `json:"filter" bson:"filter" msgpack:"filter"`
	Offset int                    `json:"offset" bson:"offset" msgpack:"offset"`
	Limit  int                    `json:"limit" bson:"limit" msgpack:"limit"`
	Order  map[string]bool        `json:"order" bson:"order" msgpack:"order"`
}

InputGet .

type InputSave

type InputSave struct {
	ID         int    `json:"id" validate:"required"`
	TrxID      string `json:"trx_id" validate:"required,numeric"`
	CustomerID string `json:"customer_id" validate:"required,numeric,startswith=62,min=10"`
	CD         string `json:"cd" validate:"required,min=1"`
	Status     string `json:"status" validate:"required"`
	Amount     int32  `json:"amount" validate:"required,numeric"`
}

InputSave .

type OutSave

type OutSave struct {
	ID int `json:"id"`
}

OutSave .

type TrxHistory

type TrxHistory struct {
	ID         int       `db:"id" validate:"required" bson:"_id" msgpack:"_id"`
	TrxID      string    `db:"trx_id" validate:"required" bson:"trx" msgpack:"trx"`
	CustomerID string    `db:"customer_id" validate:"required" bson:"customer" msgpack:"customer"`
	CD         string    `db:"cd" validate:"required" bson:"cd" msgpack:"cd"`
	Status     string    `db:"status" validate:"required" bson:"status" msgpack:"status"`
	Amount     int32     `db:"amount" validate:"required" bson:"amount" msgpack:"amount"`
	CreatedAt  time.Time `db:"created_at" validate:"required" bson:"created" msgpack:"created"`
	UpdatedAt  time.Time `db:"updated_at" validate:"required" bson:"updated" msgpack:"updated"`
}

TrxHistory struct is defined here

func NewTrxHistory

func NewTrxHistory() *TrxHistory

func (*TrxHistory) MarshalBinary

func (m *TrxHistory) MarshalBinary() ([]byte, error)

func (*TrxHistory) TableName

func (m *TrxHistory) TableName() string

func (TrxHistory) UnmarshalBinary

func (m TrxHistory) UnmarshalBinary(data []byte) error

type User

type User struct {
	ID   string
	Name string
}

User represents a user.

func (User) GetID

func (u User) GetID() string

GetID returns the user ID.

func (User) GetName

func (u User) GetName() string

GetName returns the user name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳