config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProjectName        = "git_sync"
	ProjectVersion     = "v0.0.3"
	ProjectDescription = "git_sync service"
	ProjectBundleID    = "com.git_sync.git_sync"
	APIPortDefault     = 6789
)

Variables

View Source
var (
	GlobalConfig *FileConfig
	HardSN       string
)

Functions

func LoadConfig

func LoadConfig(file string) error

func LoadData

func LoadData(cfgFilePath string) map[string]map[int64]string

func SaveConfig

func SaveConfig(file string) error

func SyncConfigFile

func SyncConfigFile(cfgFilePath string, defaultJsonContent []byte)

Types

type Auth

type Auth struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

func GetAuthInfo

func GetAuthInfo() *Auth

type ExtendApp

type ExtendApp struct {
	*gtbox_app.App
	NetListenPortStratumDefault int
	NetListenAPIPortDefault     int
	DualPoolEtcHashInsideUrl    string
}
var (
	CurrentApp *ExtendApp
)

func NewApp

func NewApp(appName, bundleID, description string, runMode gtbox.RunMode, apiPortDefault int) *ExtendApp

type FileConfig

type FileConfig struct {
	Api      api_config.ApiConfig `yaml:"api" json:"api"`
	Auth     Auth                 `yaml:"auth" json:"auth"`
	Language string               `yaml:"language" json:"language"`
}

Jump to

Keyboard shortcuts

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