guilds

package
v0.0.0-...-553e66b Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddMemberStmt *sql.Stmt
View Source
var AttachForumStmt *sql.Stmt
View Source
var GetMemberStmt *sql.Stmt
View Source
var ListStmt *sql.Stmt
View Source
var MemberListJoinStmt *sql.Stmt
View Source
var MemberListStmt *sql.Stmt
View Source
var UnattachForumStmt *sql.Stmt

Functions

func AttachForum

func AttachForum(guildID, fid int) error

func BuildGuildURL

func BuildGuildURL(slug string, id int) string

func CommonAreaWidgets

func CommonAreaWidgets(header *c.Header)

TODO: Do this properly via the widget system TODO: REWRITE THIS

func ForumCheck

func ForumCheck(args ...interface{}) (skip bool, rerr c.RouteError)

TODO: Add privacy options TODO: Add support for multiple boards and add per-board simplified permissions TODO: Take js into account for routes which expect JSON responses

func GuildWidgets

func GuildWidgets(header *c.Header, guildItem *Guild) (success bool)

TODO: Do this properly via the widget system TODO: Make a better more customisable group widget system

func MiddleViewGuild

func MiddleViewGuild(w http.ResponseWriter, r *http.Request, user *c.User) c.RouteError

func PreRenderViewForum

func PreRenderViewForum(w http.ResponseWriter, r *http.Request, user *c.User, data interface{}) (halt bool)

TODO: Prebuild this template

func PrebuildTmplList

func PrebuildTmplList(user *c.User, h *c.Header) c.CTmpl

func RouteCreateGuild

func RouteCreateGuild(w http.ResponseWriter, r *http.Request, user *c.User) c.RouteError

func RouteCreateGuildSubmit

func RouteCreateGuildSubmit(w http.ResponseWriter, r *http.Request, user *c.User) c.RouteError

func RouteGuildList

func RouteGuildList(w http.ResponseWriter, r *http.Request, user *c.User) c.RouteError

func RouteMemberList

func RouteMemberList(w http.ResponseWriter, r *http.Request, user *c.User) c.RouteError

func TopicCreatePreLoop

func TopicCreatePreLoop(args ...interface{}) interface{}

TODO: It would be nice, if you could select one of the boards in the group from that drop-down rather than just the one you got linked from

func TrowAssign

func TrowAssign(args ...interface{}) interface{}

func UnattachForum

func UnattachForum(fid int) error

func Widgets

func Widgets(args ...interface{}) interface{}

Types

type Guild

type Guild struct {
	ID      int
	Link    string
	Name    string
	Desc    string
	Active  bool
	Privacy int /* 0: Public, 1: Protected, 2: Private */

	// Who should be able to accept applications and create invites? Mods+ or just admins? Mods is a good start, we can ponder over whether we should make this more flexible in the future.
	Joinable int /* 0: Private, 1: Anyone can join, 2: Applications, 3: Invite-only */

	MemberCount    int
	Owner          int
	Backdrop       string
	CreatedAt      string
	LastUpdateTime string

	MainForumID int
	MainForum   *c.Forum
	Forums      []*c.Forum
	ExtData     c.ExtData
}

Guild is a struct representing a guild

type GuildStore

type GuildStore interface {
	Get(id int) (g *Guild, err error)
	Create(name, desc string, active bool, privacy, uid, fid int) (int, error)
}
var Gstore GuildStore

type ListPage

type ListPage struct {
	Title     string
	Header    *c.Header
	GuildList []*Guild
}

ListPage is a page struct for constructing a list of every guild

type Member

type Member struct {
	Link       string
	Rank       int    /* 0: Member. 1: Mod. 2: Admin. */
	RankString string /* Member, Mod, Admin, Owner */
	PostCount  int
	JoinedAt   string
	Offline    bool // TODO: Need to track the online states of members when WebSockets are enabled

	User c.User
}

Member is a struct representing a specific member of a guild, not to be confused with the global User struct.

type MemberListPage

type MemberListPage struct {
	Title    string
	Header   *c.Header
	ItemList []Member
	Guild    *Guild
	Page     int
	LastPage int
}

type Page

type Page struct {
	Title    string
	Header   *c.Header
	ItemList []*c.TopicsRow
	Forum    *c.Forum
	Guild    *Guild
	Page     int
	LastPage int
}

type SQLGuildStore

type SQLGuildStore struct {
	// contains filtered or unexported fields
}

func NewSQLGuildStore

func NewSQLGuildStore() (*SQLGuildStore, error)

func (*SQLGuildStore) Close

func (s *SQLGuildStore) Close()

func (*SQLGuildStore) Create

func (s *SQLGuildStore) Create(name, desc string, active bool, privacy, uid, fid int) (int, error)

func (*SQLGuildStore) Get

func (s *SQLGuildStore) Get(id int) (g *Guild, err error)

Jump to

Keyboard shortcuts

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