discuss

package
v0.0.0-...-3453337 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscussService

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

func NewService

func NewService(tailClient *tailscale.LocalClient, logger *slog.Logger, db *SQLiteDB, tmpls *template.Template, httpsURL string) *DiscussService

func (*DiscussService) DiscussionIndex

func (s *DiscussService) DiscussionIndex(w http.ResponseWriter, r *http.Request)

func (*DiscussService) DiscussionNew

func (s *DiscussService) DiscussionNew(w http.ResponseWriter, r *http.Request)

func (*DiscussService) DiscussionSave

func (s *DiscussService) DiscussionSave(w http.ResponseWriter, r *http.Request)

func (*DiscussService) DiscussionTopic

func (s *DiscussService) DiscussionTopic(w http.ResponseWriter, r *http.Request)

func (*DiscussService) RenderError

func (s *DiscussService) RenderError(w http.ResponseWriter, r *http.Request, err error, code int)

type Post

type Post struct {
	ID        int64     `db:"ID"`
	Body      string    `db:"Body"`
	CreatedAt time.Time `db:"CreatedAt"`
	User      string    `db:"User"`
}

type SQLiteDB

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

func NewSQLiteDB

func NewSQLiteDB(f string, logger *slog.Logger) (*SQLiteDB, error)

func (*SQLiteDB) LoadTopic

func (s *SQLiteDB) LoadTopic(ctx context.Context, id int64) ([]*Post, error)

func (*SQLiteDB) LoadTopics

func (s *SQLiteDB) LoadTopics(ctx context.Context) ([]*Topic, error)

func (*SQLiteDB) SavePost

func (s *SQLiteDB) SavePost(ctx context.Context, topic *Topic) (postid int64, err error)

func (*SQLiteDB) SaveTopic

func (s *SQLiteDB) SaveTopic(ctx context.Context, topic *Topic) (tid int64, err error)

type Topic

type Topic struct {
	ID        int64     `db:"ID"`
	User      string    `db:"User"`
	Topic     string    `db:"Topic"`
	Body      string    `db:"Body"`
	CreatedAt time.Time `db:"CreatedAt"`
}

Jump to

Keyboard shortcuts

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