model

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextKey

type ContextKey int
const (
	LOGGER ContextKey = iota
)

type DataModel

type DataModel struct {
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type Model

type Model struct {
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	DeletedAt time.Time `json:"deleted_at"`
}

type Result

type Result struct {
	Status ResultStatus `json:"status"`
	Msg    string       `json:"msg"`
	Data   any          `json:"data"`
	Time   time.Time    `json:"time"`
}

func FailureResult

func FailureResult(err error) *Result

func SuccessResult

func SuccessResult(msg string) *Result

func (*Result) Bytes added in v1.0.1

func (r *Result) Bytes() ([]byte, error)

type ResultStatus

type ResultStatus string
const (
	SUCCESS ResultStatus = "success"
	FAILURE ResultStatus = "failure"
)

Jump to

Keyboard shortcuts

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