server

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDryRunFinished = errors.New("dry run finished")

Functions

This section is empty.

Types

type FilterRepository

type FilterRepository interface {
	GetFilter(name string) (*filters.Filter, error)
	GetFilters() []*filters.Filter
	GetTags() []string
	Render(w io.Writer, name string, data map[string]interface{}) error
}

type Options

type Options struct {
	Address             string `default:"127.0.0.1:8765" help:"address to listen to"`
	UseSystemdSocket    bool   `help:"use a systemd socket instead of opening a port"`
	DatabaseUrl         string `default:"postgresql:///letsblockit" help:"psql database to connect to"`
	LogLevel            string `default:"info" enum:"debug,info,warn,error,off" help:"http log level"`
	AuthMethod          string `required:"" enum:"kratos,proxy" help:"authentication method to use"`
	AuthKratosUrl       string `default:"http://localhost:4000/.ory" help:"url of the kratos API, defaults to using local ory proxy"`
	AuthProxyHeaderName string `placeholder:"X-Auth-Request-User" help:"name for the cookie set by the reverse proxy"`
	ListDownloadDomain  string `help:"domain to use for list downloads, leave empty to use the main domain"`
	StatsdTarget        string `placeholder:"localhost:8125" help:"address to send statsd metrics to, disabled by default"`
	CacheDir            string `placeholder:"/tmp" help:"folder to cache external resources in during local development"`
	OfficialInstance    bool   `help:"turn on behaviours specific to the official letsblock.it instances"`
	HotReload           bool   `help:"reload frontend when the backend restarts"`
	DryRun              bool   `hidden:""`
}

type PageRenderer

type PageRenderer interface {
	RegisterHelpers(helpers map[string]interface{})
	RegisterContextBuilder(b pages.ContextBuilder)
	BuildPageContext(c echo.Context, title string) *pages.Context
	Render(c echo.Context, name string, data *pages.Context) error
	RenderWithSidebar(c echo.Context, name, sidebar string, data *pages.Context) error
	RedirectToPage(c echo.Context, name string, params ...interface{}) error
	Redirect(c echo.Context, code int, target string) error
}

type ReleaseClient

type ReleaseClient interface {
	GetReleases() ([]*news.Release, error)
	GetLatestAt() (time.Time, error)
}

type Server

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

func NewServer

func NewServer(options *Options) *Server

func (*Server) Start

func (s *Server) Start() error

type UserPreferenceManager

type UserPreferenceManager interface {
	Get(c echo.Context, user string) (*db.UserPreference, error)
	UpdateNewsCursor(c echo.Context, user string, at time.Time) error
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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