config

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfigBase = "nanafs.conf"
)

Variables

View Source
var FilePath string

Functions

func LocalUserPath

func LocalUserPath() string

Types

type Api

type Api struct {
	Enable bool   `json:"enable"`
	Host   string `json:"host"`
	Port   int    `json:"port"`
	Pprof  bool   `json:"pprof"`
}

type Config

type Config struct {
	Meta      Meta      `json:"meta"`
	Storages  []Storage `json:"storages"`
	CacheDir  string    `json:"cache_dir,omitempty"`
	CacheSize int64     `json:"cache_size,omitempty"`
	Debug     bool      `json:"debug"`

	ApiConfig Api `json:"api"`
	FsConfig  Fs  `json:"fs"`
}

type Fs

type Fs struct {
	Enable      bool   `json:"enable"`
	RootPath    string `json:"root_path"`
	DisplayName string `json:"display_name,omitempty"`
}

type Loader

type Loader interface {
	GetConfig() (Config, error)
}

func NewConfigLoader

func NewConfigLoader() Loader

type Meta

type Meta struct {
	Type string `json:"type"`
	Path string `json:"path"`
}

type Storage

type Storage struct {
	ID        string `json:"id"`
	LocalDir  string `json:"local_dir,omitempty"`
	CacheDir  string `json:"cache_dir,omitempty"`
	CacheSize int64  `json:"cache_size,omitempty"`
}

Jump to

Keyboard shortcuts

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