model

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextKey

type ContextKey int
const (
	Config ContextKey = iota
	EdgeID
	Logger
	RequestInfo
)

type Model added in v1.0.4

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

type Result added in v1.0.4

type Result struct {
	Status ResultStatus
	Msg    string
	Data   any
	Raw    json.RawMessage
	Time   time.Time
}

func FailureResult added in v1.0.4

func FailureResult(err error) *Result

func SuccessResult added in v1.0.4

func SuccessResult(msg string) *Result

func (*Result) Error added in v1.0.4

func (r *Result) Error() error

func (*Result) MarshalJSON added in v1.0.4

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

func (*Result) UnmarshalJSON added in v1.0.4

func (r *Result) UnmarshalJSON(data []byte) error

type ResultStatus added in v1.0.4

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