Documentation ¶
Index ¶
Constants ¶
View Source
const (
PGConstraintUniqueTokenAndTokenDate = "idx_unq_tokens_token_token_date"
)
View Source
const (
PGErrCodeUniqueViolation = "23505"
)
Variables ¶
View Source
var (
ErrInputValidation = fmt.Errorf("validation input error")
)
Functions ¶
func GenerateID ¶
func GenerateID() string
GenerateID generates a unique ID that can be used as an identifier for an entity.
Types ¶
type Input ¶
type Input struct { CustomerID string `json:"customer_id" validate:"required,numeric,startswith=62,min=10"` Status int `json:"status" validate:"required"` Credential string `json:"credential" validate:"required,numeric,min=6,max=6"` }
Input
type Output ¶
type Output struct { ID string `json:"id"` CustomerID string `json:"customer_id"` Status int `json:"status"` Credential string `json:"credential"` }
OutGenerate .
type Pin ¶
type Pin struct { ID string `db:"id" validate:"required,uuid"` CustomerID string `db:"customer_id" validate:"required"` Status int `db:"status" validate:"required"` Credential string `db:"credential" validate:"required"` CreatedAt time.Time `db:"created_at" validate:"required"` UpdatedAt time.Time `db:"updated_at" validate:"required"` Metadata Metadata `db:"metadata" validate:"-"` }
pin struct is defined here
Click to show internal directories.
Click to hide internal directories.