config

package
v0.0.0-...-522d66a Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const LockVersion = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Bundler struct {
		Debug bool   `toml:"debug-log"`
		Path  string `toml:"server-path"`
	}

	Server struct {
		Api string `toml:"api"`
		// ApiReplace is an optional argument that allows a local saddle API version to be used instead of one pulled
		// from GitHub.
		ApiReplace string `toml:"replace-api"`
		Dragonfly  string `toml:"dragonfly"`
		// DragonflyReplace is an optional argument that allows a local dragonfly version to be used instead of one pulled
		// from GitHub.
		DragonflyReplace string `toml:"replace-dragonfly"`
	} `toml:"server"`

	Plugin []PluginInfo `toml:"plugin"`
}

func GetOrMakeConfig

func GetOrMakeConfig(log *zerolog.Logger, path string) *Config

GetOrMakeConfig tries to load the config file, and if it does not exist the default config file will be created and loaded.

type LockFile

type LockFile struct {
	// Version is the version the lockfile was made in.
	Version uint
	// Api is the version of the saddle api.
	Api string
	// Dragonfly is the dragonfly version used.
	Dragonfly string
	// Plugins is a map which contains all the plugin checksums. The keys are the plugin module names.
	Plugins map[string]string
}

LockFile contains information about the currently existing server binaries. It is used to determine whether it is up-to-date with the latest configuration.

func GetLock

func GetLock(log *zerolog.Logger, path string) (LockFile, bool)

GetLock returns the current lockfile. If it does not exist, or if the lockfile is of a previous version, an empty lockfile and false will be returned.

type PluginInfo

type PluginInfo = map[string]any

Jump to

Keyboard shortcuts

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