backend

package
v0.0.0-...-40571b5 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ImplAuth = func(b *Backend, user, pass string) error {
	return nil
}
View Source
var ImplIsMod = func(b *Backend) bool {
	return false
}
View Source
var ImplMaxPostSize = func(b *Backend) int64 {
	return 1024 * 1024
}

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Groups       map[string]*Group
	Articles     map[[16]byte]*common.ArticleRef
	Mods         map[string]*common.ModInfo
	Index        *os.File
	Data         []*os.File
	AuthObject   interface{}
	PostInterval time.Duration

	ServerName string
	// contains filtered or unexported fields
}

func (*Backend) AllowPost

func (tb *Backend) AllowPost() bool

func (*Backend) Authenticate

func (tb *Backend) Authenticate(user, pass string) (nnn.Backend, error)

func (*Backend) Authorized

func (tb *Backend) Authorized() bool

func (*Backend) DeleteArticle

func (tb *Backend) DeleteArticle(msgid string) error

func (*Backend) GetArticle

func (tb *Backend) GetArticle(group *nnn.Group, id string, ho bool) (*nnn.Article, error)

func (*Backend) GetArticles

func (tb *Backend) GetArticles(group *nnn.Group, from, to int64, ho bool) ([]nnn.NumberedArticle, error)

func (*Backend) GetGroup

func (tb *Backend) GetGroup(name string) (*nnn.Group, error)

func (*Backend) Init

func (tb *Backend) Init()

func (*Backend) ListGroups

func (tb *Backend) ListGroups(max int) ([]*nnn.Group, error)

func (*Backend) Post

func (tb *Backend) Post(article *nnn.Article) error

func (*Backend) WriteCommand

func (tb *Backend) WriteCommand(buf []byte) error

type Group

type Group struct {
	Group    *nnn.Group
	BaseInfo *common.BaseGroupInfo
	Articles *common.HighLowSlice
}

func (*Group) Append

func (g *Group) Append(b *Backend, ar *common.ArticleRef)

Jump to

Keyboard shortcuts

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