config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package config the configuration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, config Config) context.Context

NewContext returns a context that contains the given Config.

Types

type Config

type Config struct {
	// Cache
	Cache cache.Options `yaml:"cache"`

	// Fetch
	Fetch fetch.Options `yaml:"fetch"`

	// Plugin
	Plugin PluginConfig `yaml:"plugin"`

	// JS
	JS js.Options `yaml:"js"`
}

Config The cloudcat configuration

func DefaultConfig

func DefaultConfig() Config

DefaultConfig The default configuration

func FromContext

func FromContext(ctx context.Context) Config

FromContext returns the Config stored in ctx by NewContext, or the default Config if there is none.

func ReadConfig

func ReadConfig(path string) (config Config, err error)

ReadConfig read configuration from the file. If the configuration file is not existing then create it with default configuration.

type PluginConfig

type PluginConfig struct {
	Path string `yaml:"path"`
}

Jump to

Keyboard shortcuts

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