ipfd

package
v0.0.0-...-77ea108 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version string

Functions

This section is empty.

Types

type Config

type Config struct {
	SiteURL             string
	SitePath            string
	SiteName            string
	BindAddress         string
	DatabaseURL         string
	TemplatesPath       string
	StaticPath          string
	StaticURL           string
	ServeStatic         bool
	IpfsAPI             []string
	IpfsGateway         string
	IpfsPin             bool
	MaxFileSize         int64
	AllowedContentTypes []string
	Premoderation       bool
	EnableComments      bool
	EnableVotes         bool
}

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

type Server

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

func New

func New(config *Config, log *log.Logger, dbStore store.Store, ipfsShells []ipfs.Shell) *Server

func (*Server) BoardHandler

func (s *Server) BoardHandler(w http.ResponseWriter, r *http.Request)

func (*Server) CommentFeed

func (s *Server) CommentFeed(w http.ResponseWriter, r *http.Request)

func (*Server) CreateCommentHandler

func (s *Server) CreateCommentHandler(w http.ResponseWriter, r *http.Request)

func (*Server) CreatePostHandler

func (s *Server) CreatePostHandler(w http.ResponseWriter, r *http.Request)

func (*Server) DownvoteHandler

func (s *Server) DownvoteHandler(w http.ResponseWriter, r *http.Request)

func (*Server) GetAddress

func (s *Server) GetAddress(r *http.Request) (*models.Address, error)

func (*Server) InternalError

func (s *Server) InternalError(w *http.ResponseWriter, err error)

Log an error and display a generic message

func (*Server) PostFeed

func (s *Server) PostFeed(w http.ResponseWriter, r *http.Request)

func (*Server) PostViewHandler

func (s *Server) PostViewHandler(w http.ResponseWriter, r *http.Request)

func (*Server) RedirectBack

func (s *Server) RedirectBack(w http.ResponseWriter, r *http.Request)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) UpvoteHandler

func (s *Server) UpvoteHandler(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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