models

package
v0.5.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentTypePost    = "post"
	ContentTypePage    = "page"
	ContentTypeAttach  = "attachment"
	ContentStatusPost  = "publish"
	ContentStatusDraft = "draft"
)
View Source
const CurrentSchemaVersion = 1

Variables

This section is empty.

Functions

func CreatePluginTables

func CreatePluginTables(ctx context.Context, db *sql.DB, dialect string, owner string, tables []plugin.TableDefinition) error

func DropPluginTables

func DropPluginTables(ctx context.Context, db *sql.DB, dialect string, owner string, tables []plugin.TableDefinition) error

func InitializeSchema

func InitializeSchema(ctx context.Context, db *sql.DB, driver string) error

func LimitOffset

func LimitOffset(d Dialect, limit, offset int) (string, []any)

func PluginTableName

func PluginTableName(owner, name string) string

func Rebind

func Rebind(d Dialect, query string) string

func UpsertOptionSQL

func UpsertOptionSQL(d Dialect) string

Types

type AttachmentMeta

type AttachmentMeta struct {
	Name        string `json:"name"`
	Path        string `json:"path"`
	URL         string `json:"url"`
	Size        int64  `json:"size"`
	Type        string `json:"type"`
	MIME        string `json:"mime"`
	Description string `json:"description,omitempty"`
	IsImage     bool   `json:"isImage"`
	Width       int    `json:"width"`
	Height      int    `json:"height"`
}

type Comment

type Comment struct {
	COID        int64
	CID         int64
	Created     int64
	Author      string
	AuthorID    int64
	OwnerID     int64
	Mail        string
	URL         string
	IP          string
	Agent       string
	Text        string
	Type        string
	Status      string
	Parent      int64
	Title       string
	Slug        string
	ContentType string
}

type Content

type Content struct {
	CID          int64
	Title        string
	Slug         string
	SlugID       int64
	Created      int64
	Modified     int64
	Text         string
	SortOrder    int64
	AuthorID     int64
	Template     string
	Type         string
	Status       string
	Password     string
	CommentsNum  int64
	AllowComment string
	AllowPing    string
	AllowFeed    string
	Parent       int64
	DraftOf      int64
}

func (Content) CreatedAt

func (c Content) CreatedAt() time.Time

func (Content) ModifiedAt

func (c Content) ModifiedAt() time.Time

type Dialect

type Dialect string
const (
	DialectSQLite   Dialect = "sqlite"
	DialectMySQL    Dialect = "mysql"
	DialectPostgres Dialect = "postgres"
)

func NormalizeDialect

func NormalizeDialect(driver string) Dialect

type Field

type Field struct {
	FID        int64
	CID        int64
	Name       string
	Type       string
	StrValue   string
	IntValue   int64
	FloatValue float64
	ReadOnly   bool
}

type Meta

type Meta struct {
	MID         int64
	Name        string
	Slug        string
	Type        string
	Description string
	Count       int64
	SortOrder   int64
	Parent      int64
}

type Option

type Option struct {
	Name  string
	User  int64
	Value string
}

type Relationship

type Relationship struct {
	CID int64 `json:"cid"`
	MID int64 `json:"mid"`
}

type Revision

type Revision struct {
	RID          int64
	CID          int64
	Created      int64
	AuthorID     int64
	Title        string
	Slug         string
	Text         string
	Status       string
	Password     string
	SortOrder    int64
	Template     string
	Parent       int64
	AllowComment string
	AllowPing    string
	AllowFeed    string
}

type Stats

type Stats struct {
	Posts      int64
	Pages      int64
	Comments   int64
	Categories int64
	Tags       int64
	Users      int64
	Waiting    int64
}

type User

type User struct {
	UID        int64
	Name       string
	Password   string
	Mail       string
	URL        string
	ScreenName string
	Created    int64
	Activated  int64
	Logged     int64
	Role       string
	AuthCode   string
}

Jump to

Keyboard shortcuts

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