models

package
v0.0.0-...-40b14aa Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxUint16 = 65535
	MaxUint32 = 4294967295
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Blacklist

type Blacklist struct {
	gorm.Model
	Pubkey string `json:"pubkey" gorm:"type:varchar(64)"`
}

func (Blacklist) TableName

func (Blacklist) TableName() string

type EventAddon

type EventAddon struct {
	UpdatedAt  nostr.Timestamp `json:"updated_at"`
	DeletedAt  nostr.Timestamp `json:"deleted_at"`
	Expiration nostr.Timestamp `json:"expiration"`
	UpdatedIP  string          `json:"updated_ip"`
}

type Page

type Page struct {
	PageInformation *PageInformation `json:"page_information,omitempty"`
	Entities        interface{}      `json:"entities,omitempty"`
}

Page page model

func NewPage

func NewPage(pageInfo *PageInformation, entities interface{}) *Page

NewPage new page

func (*Page) GetEntities

func (p *Page) GetEntities() interface{}

GetEntities get entities

type PageForm

type PageForm struct {
	Page    int    `json:"page,omitempty" form:"page" query:"page"`
	Size    int    `json:"size,omitempty" form:"size" query:"size"`
	Query   string `json:"query,omitempty" form:"query" query:"query"`
	Sort    string `json:"sort,omitempty" form:"sort" query:"sort"`
	Reverse bool   `json:"reverse,omitempty" form:"reverse" query:"reverse"`
	OrderBy string `json:"-" form:"-"`
}

PageForm page form

func (*PageForm) GetOrderBy

func (f *PageForm) GetOrderBy() string

GetOrderBy get order by

func (*PageForm) GetPage

func (f *PageForm) GetPage() int

GetPage get page

func (*PageForm) GetQuery

func (f *PageForm) GetQuery() string

GetQuery get query

func (*PageForm) GetReverse

func (f *PageForm) GetReverse() bool

GetReverse get reverse

func (*PageForm) GetSize

func (f *PageForm) GetSize() int

GetSize get size

func (*PageForm) GetSort

func (f *PageForm) GetSort() string

GetSort get sort

type PageInformation

type PageInformation struct {
	Page     int   `json:"page,omitempty"`
	Size     int   `json:"size,omitempty"`
	Count    int64 `json:"count,omitempty"`
	LastPage int   `json:"last_page,omitempty"`
}

PageInformation page information

type RelayEvent

type RelayEvent struct {
	ID         string          `json:"id" gorm:"primaryKey;type:varchar(64)"`
	CreatedAt  nostr.Timestamp `json:"created_at" gorm:"type:integer"`
	UpdatedAt  nostr.Timestamp `json:"-" gorm:"type:integer"`
	DeletedAt  nostr.Timestamp `json:"-" gorm:"type:integer"`
	Pubkey     string          `json:"pubkey" gorm:"type:varchar(64)"`
	Kind       int             `json:"kind" gorm:"type:integer"`
	Content    string          `json:"content"`
	Tags       nostr.Tags      `json:"tags" gorm:"type:jsonb"`
	Sig        string          `json:"sig"`
	Tagvalues  []string        `json:"-" gorm:"-"`
	Expiration nostr.Timestamp `json:"-" gorm:"type:integer"`
	UpdatedIP  string          `json:"-" gorm:"-"`
}

func (RelayEvent) TableName

func (RelayEvent) TableName() string

Jump to

Keyboard shortcuts

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