models

package
v0.0.0-...-812c7a9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ALL_MODELS []any = []any{&Action{}, &ActionStatus{}, &Event{}}

Functions

func GetDb

func GetDb() *gorm.DB

Types

type Action

type Action struct {
	ID        uint      `json:"-"`
	CreatedAt time.Time `json:"-"`

	Status   ActionStatus `json:"-"`
	StatusID uint         `json:"-"`

	LastLaunch  *DateOnly
	Events      []Event
	Name        string
	ShortDesc   string
	Description string
	Cmd         string
}

type ActionStatus

type ActionStatus struct {
	ID          uint
	Name        string
	Description string
}

type DateOnly

type DateOnly struct {
	time.Time
}

DateOnly Структура, сохраняющаяся в БД и представляющая дату без времени

func (DateOnly) MarshalJSON

func (do DateOnly) MarshalJSON() ([]byte, error)

func (*DateOnly) Scan

func (do *DateOnly) Scan(src any) error

func (*DateOnly) ToTime

func (do *DateOnly) ToTime() time.Time

func (*DateOnly) UnmarshalJSON

func (do *DateOnly) UnmarshalJSON(data []byte) (err error)

func (DateOnly) Value

func (do DateOnly) Value() (driver.Value, error)

type Event

type Event struct {
	ID        uint
	ActionID  uint
	Type      string
	TimeStamp TimeStamp
}

type TimeStamp

type TimeStamp struct {
	time.Time
}

DateOnly Структура, сохраняющаяся в БД и представляющая дату без времени

func (TimeStamp) MarshalJSON

func (do TimeStamp) MarshalJSON() ([]byte, error)

func (*TimeStamp) Scan

func (do *TimeStamp) Scan(src any) error

func (*TimeStamp) ToTime

func (do *TimeStamp) ToTime() time.Time

func (*TimeStamp) UnmarshalJSON

func (do *TimeStamp) UnmarshalJSON(data []byte) (err error)

func (TimeStamp) Value

func (do TimeStamp) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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