core

package
v0.0.0-...-204aec8 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IndexPage   = "Index"
	WikiSection = "wiki"

	IndexURI = WikiSection + "/" + IndexPage

	RootURI      = "/"
	WikiURI      = "/wiki"
	LoginURI     = "/login"
	LogoutURI    = "/logout"
	TotpURI      = "/totp"
	SectionsURI  = "/sections"
	SectionURI   = "/section"
	SearchURI    = "/search"
	StatsURI     = "/stats"
	NewURI       = "/new"
	BlacklistURI = "/blacklist"
	UsersURI     = "/users"
	UserURI      = "/user"
	ViewURI      = "/view"
	StaticURI    = "/static"
)

Variables

This section is empty.

Functions

func Contains

func Contains(str string, a []string) (int, bool)

Contains checks if slice a contains string str

func ReadPerm

func ReadPerm(username string, p Permission, s Section) bool

func WritePerm

func WritePerm(username string, p Permission, s Section) bool

Types

type Config

type Config struct {
	DataDir      string `json:"data_dir,omitempty"`
	User         string `json:"user,omitempty"`
	Group        string `json:"group,omitempty"`
	ListenAddr   string `json:"listen_addr,omitempty"`
	LogFile      string `json:"log_file,omitempty"`
	Version      string `json:"-"`
	Secret       string `json:"secret,omitempty"`
	Admin        bool   `json:"admin,omitempty"`
	Foreground   bool   `json:"foreground,omitempty"`
	SecureCookie bool   `json:"secure_cookie,omitempty"`
	Debug        bool   `json:"debug,omitempty"`
}

type Page

type Page struct {
	Title      string        `json:"title"`
	StoreTitle string        `json:"store_title"`
	Markdown   string        `json:"markdown"`
	HTML       template.HTML `json:"html"`
	Created    string        `json:"created"`
	Updated    string        `json:"updated"`
	Perm       Permission    `json:"perm"`
}

type Pages

type Pages []Page

func (Pages) Len

func (p Pages) Len() int

func (Pages) Less

func (p Pages) Less(i, j int) bool

func (Pages) Swap

func (p Pages) Swap(i, j int)

type Permission

type Permission int
const (
	Invalid Permission = iota
	Public
	Private
)

func ParsePermString

func ParsePermString(p string) Permission

type Result

type Result struct {
	Title      string
	Section    string
	StoreTitle string
	HTML       template.HTML
}

type Section

type Section struct {
	Name    string
	User    bool
	Members []string
}

type SectionPage

type SectionPage struct {
	Section string
	Pages   UpdatedPages
}

type SectionPages

type SectionPages []SectionPage

func (SectionPages) Len

func (s SectionPages) Len() int

func (SectionPages) Less

func (s SectionPages) Less(i, j int) bool

func (SectionPages) Swap

func (s SectionPages) Swap(i, j int)

type Sections

type Sections []Section

func (Sections) Len

func (s Sections) Len() int

func (Sections) Less

func (s Sections) Less(i, j int) bool

func (Sections) Swap

func (s Sections) Swap(i, j int)

type Stats

type Stats struct {
	Goroutines int
	Alloc      string
	Sys        string
	Docs       uint64
	GoVersion  string
}

type UpdatedPages

type UpdatedPages []Page

func (UpdatedPages) Len

func (p UpdatedPages) Len() int

func (UpdatedPages) Less

func (p UpdatedPages) Less(i, j int) bool

func (UpdatedPages) Swap

func (p UpdatedPages) Swap(i, j int)

type User

type User struct {
	Username string
	Password string
	Created  string
	Secret   string
	Admin    bool
	Locked   int
}

type Users

type Users []*User

func (Users) Len

func (u Users) Len() int

func (Users) Less

func (u Users) Less(i, j int) bool

func (Users) Swap

func (u Users) Swap(i, j int)

Jump to

Keyboard shortcuts

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