models

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID      uint   `gorm:"primaryKey" json:"id"`
	Hash    string `gorm:"index:idx_event_hash,unique" json:"unique_hash"`
	City    string `gorm:"size:255;not null" json:"city"`
	Address string `gorm:"type:text;not null" json:"address"`

	Start     time.Time `json:"start"`
	End       time.Time `json:"end"`
	CreatedAt time.Time `json:"created_at"`
}

func (*Event) EndClock added in v0.0.4

func (e *Event) EndClock() string

func (*Event) ResetHash

func (e *Event) ResetHash()

func (*Event) StartClock added in v0.0.4

func (e *Event) StartClock() string

type Listener

type Listener struct {
	ID uint `gorm:"primaryKey" json:"id"`

	// ChatID
	TelegramCID int64 `gorm:"not null" json:"-"`
	// ThreadID
	TelegramTID int64 `gorm:"null" json:"-"`

	// Search Text (sql `like`)
	SearchTerm string `gorm:"type:text;not null;uniqueIndex:idx_listener_term_city" json:"search_term"`
	City       string `gorm:"size:255;not null;uniqueIndex:idx_listener_term_city" json:"city"`
}

type Notification added in v0.0.4

type Notification struct {
	Listener *Listener
	Event    *Event
}

Jump to

Keyboard shortcuts

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