config

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchParser

type ArchParser struct {
	X86 interface{} `yaml:"x86"`
	Arm interface{} `yaml:"arm"`
}

func (*ArchParser) Get

func (p *ArchParser) Get() string

type BaseParser

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

func (*BaseParser) GetBool added in v1.1.3

func (p *BaseParser) GetBool() bool

func (*BaseParser) GetInt

func (p *BaseParser) GetInt() int

func (*BaseParser) GetInt64

func (p *BaseParser) GetInt64() int64

type Config

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

func Parse

func Parse(data []byte, parseType ParseType) (*Config, error)

func (*Config) Get

func (c *Config) Get(key string) string

func (*Config) GetBool added in v1.1.3

func (c *Config) GetBool(key string) bool

func (*Config) GetInt added in v1.1.3

func (c *Config) GetInt(key string) int

func (*Config) GetInt64 added in v1.1.3

func (c *Config) GetInt64(key string) int64

func (*Config) Parse

func (c *Config) Parse(fileName string, parseType ParseType) error

type EnvParser

type EnvParser struct {
	Default interface{} `yaml:"default"`
	Env     interface{} `yaml:"env"`
}

func (*EnvParser) Get

func (p *EnvParser) Get() string

type OsParser

type OsParser struct {
	Linux   interface{} `yaml:"linux"`
	Windows interface{} `yaml:"windows"`
}

func (*OsParser) Get

func (value *OsParser) Get() string

type ParseType

type ParseType string
const JSON ParseType = "JSON"
const XML ParseType = "XML"
const YAML ParseType = "YAML"

type Parser

type Parser interface {
	GetBool() bool
	GetInt() int
	GetInt64() int64
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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