notice

package
v0.0.0-...-ba036dd Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_CHAIN = "dimension"
View Source
const MAX_LIMIT = 30

Variables

View Source
var DefaultPaginationCond = PaginationCond{
	Limit: 0,
	Asc:   false,
	After: ^uint(0) >> 1,
}

Functions

This section is empty.

Types

type Notice

type Notice interface {
	Notices(chain string, startTs int64, cond PaginationCond) ([]NoticeItem, error)
}

func NewService

func NewService(db *gorm.DB) Notice

type NoticeItem

type NoticeItem struct {
	Id          uint      `json:"id"`
	Chain       string    `json:"chain"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	Date        time.Time `json:"date" gorm:"index:notice_date_idx type:timestamp without time zone"`
}

type PaginationCond

type PaginationCond struct {
	After uint `json:"after,omitempty"`
	Limit uint `json:"limit,omitempty"`
	Asc   bool `json:"asc,omitempty"`
}

PaginationCond contains pagination conditions Limit is the maximum number of items to return Asc is the order of items to return (default: descending order)

func (*PaginationCond) Trim

func (p *PaginationCond) Trim()

Jump to

Keyboard shortcuts

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