glance

package
v0.0.0-...-a089732 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileServerWithCache

func FileServerWithCache(fs http.FileSystem, cacheDuration time.Duration) http.Handler

func Main

func Main() int

Types

type Application

type Application struct {
	Version string
	Config  Config
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication(config *Config) (*Application, error)

func (*Application) HandleNotFound

func (a *Application) HandleNotFound(w http.ResponseWriter, r *http.Request)

func (*Application) HandlePageContentRequest

func (a *Application) HandlePageContentRequest(w http.ResponseWriter, r *http.Request)

func (*Application) HandlePageRequest

func (a *Application) HandlePageRequest(w http.ResponseWriter, r *http.Request)

func (*Application) Serve

func (a *Application) Serve() error

type CliIntent

type CliIntent uint8
const (
	CliIntentServe       CliIntent = iota
	CliIntentCheckConfig           = iota
)

type CliOptions

type CliOptions struct {
	Intent     CliIntent
	ConfigPath string
}

func ParseCliOptions

func ParseCliOptions() (*CliOptions, error)

type Column

type Column struct {
	Size    string         `yaml:"size"`
	Widgets widget.Widgets `yaml:"widgets"`
}

type Config

type Config struct {
	Server Server `yaml:"server"`
	Theme  Theme  `yaml:"theme"`
	Pages  []Page `yaml:"pages"`
}

func NewConfig

func NewConfig() *Config

func NewConfigFromYml

func NewConfigFromYml(contents io.Reader) (*Config, error)

type Page

type Page struct {
	Title            string   `yaml:"name"`
	Slug             string   `yaml:"slug"`
	ShowMobileHeader bool     `yaml:"show-mobile-header"`
	Columns          []Column `yaml:"columns"`
	// contains filtered or unexported fields
}

func (*Page) UpdateOutdatedWidgets

func (p *Page) UpdateOutdatedWidgets()

type Server

type Server struct {
	Host       string    `yaml:"host"`
	Port       uint16    `yaml:"port"`
	AssetsPath string    `yaml:"assets-path"`
	StartedAt  time.Time `yaml:"-"`
}

type Theme

type Theme struct {
	BackgroundColor          *widget.HSLColorField `yaml:"background-color"`
	PrimaryColor             *widget.HSLColorField `yaml:"primary-color"`
	PositiveColor            *widget.HSLColorField `yaml:"positive-color"`
	NegativeColor            *widget.HSLColorField `yaml:"negative-color"`
	Light                    bool                  `yaml:"light"`
	ContrastMultiplier       float32               `yaml:"contrast-multiplier"`
	TextSaturationMultiplier float32               `yaml:"text-saturation-multiplier"`
	CustomCSSFile            string                `yaml:"custom-css-file"`
}

Jump to

Keyboard shortcuts

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