publish

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteSite added in v0.1.1

func DeleteSite(siteID string) error

func GetFile

func GetFile(siteID, path string) (string, error)

func GetSiteOwner

func GetSiteOwner(siteID string) (string, error)

func GetSiteSlug

func GetSiteSlug(siteID string) (string, error)

func GetSlug

func GetSlug(slug string) (slugResponse, error)

func NewFile

func NewFile(file *File) error

func RemoveFile

func RemoveFile(siteID, path string) error

func SetSlug

func SetSlug(slug, id string) error

Types

type File

type File struct {
	Path    string `json:"path,omitempty" gorm:"uniqueIndex:idx_path_site"`
	CTime   int64  `json:"ctime,omitempty"`
	Hash    string `json:"hash,omitempty"`
	MTime   int64  `json:"mtime,omitempty"`
	Size    int64  `json:"size,omitempty"`
	Data    string `json:"data,omitempty"`
	Slug    string `json:"site,omitempty" gorm:"uniqueIndex:idx_path_site"`
	Deleted bool   `json:"deleted"`
}

func GetFiles

func GetFiles(siteID string) ([]*File, error)

type Site

type Site struct {
	ID      string `json:"id,omitempty"`
	Host    string `json:"host,omitempty"`
	Created int64  `json:"created,omitempty"`
	Owner   string `json:"owner,omitempty"`
	Slug    string `json:"slug,omitempty"`
	Options string `json:"options,omitempty"`
	Size    int64  `json:"size"`
}

func CreateSite

func CreateSite(owner string) (*Site, error)

func GetSites

func GetSites(userEmail string) ([]*Site, error)

Jump to

Keyboard shortcuts

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