model

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 4 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
	REQUEST_INFO
)

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
	Msg    string
	Data   any
	Raw    json.RawMessage
	Time   time.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)

func (*Result) Error added in v1.0.5

func (r *Result) Error() error

func (*Result) MarshalJSON added in v1.0.5

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

func (*Result) UnmarshalJSON added in v1.0.5

func (r *Result) UnmarshalJSON(data []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