configuration

package
v0.0.0-...-313507d Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindFiles

func FindFiles(rootDir, fileName string) (error, string)

func GetFiles

func GetFiles(dirPath string) ([]string, int64)

func ReadFile

func ReadFile(filePath string, decoder *encoding.Decoder) (*[]byte, error)

Types

type CommonConf

type CommonConf struct {
	BinPath        string        `json:"BinPath" yaml:"BinPath"`
	OutDir         string        `json:"OutDir" yaml:"OutDir"`
	GitRep         string        `json:"GitRep" yaml:"GitRep"`
	RepositoryConf []*Repository `json:"RepositoryConf" yaml:"RepositoryConf"`
	Extensions     *struct {
		ExtensionsDir string `json:"ExtensionsDir" yaml:"ExtensionsDir"`
	} `json:"Extensions" yaml:"Extensions"`
	FreshConf []*FreshConf `json:"FreshConf" yaml:"FreshConf"`
	Network   *struct {
		PROXY_ADDR string `json:"PROXY_ADDR" yaml:"PROXY_ADDR"`
		ListenPort string `json:"ListenPort" yaml:"ListenPort"`
		UseNgrok   bool   `json:"UseNgrok" yaml:"UseNgrok"`
		WebhookURL string `json:"WebhookURL" yaml:"WebhookURL"`
	} `json:"Network" yaml:"Network"`
	Jenkins *struct {
		URL       string `json:"URL" yaml:"URL"`
		Login     string `json:"Login" yaml:"Login"`
		Password  string `json:"Password" yaml:"Password"`
		UserToken string `json:"UserToken" yaml:"UserToken"`
	} `json:"Jenkins" yaml:"Jenkins"`
	Zabbix *struct {
		URL      string `json:"URL" yaml:"URL"`
		Login    string `json:"Login" yaml:"Login"`
		Password string `json:"Password" yaml:"Password"`
	} `json:"Zabbix" yaml:"Zabbix"`
	Charts *struct {
		Login    string            `json:"Login" yaml:"Login"`
		Password string            `json:"Password" yaml:"Password"`
		Services map[string]string `json:"Services" yaml:"Services"`
	} `json:"Charts" yaml:"Charts"`
	LogDir       string `json:"LogDir" yaml:"LogDir"`
	BotToken     string `json:"BotToken" yaml:"BotToken"`
	Debug        bool   `json:"Debug" yaml:"Debug"`
	ResetWebhook bool   `json:"ResetWebhook" yaml:"ResetWebhook"`
	Redis        string `json:"Redis" yaml:"Redis"`
	SUI          struct {
		URL  string `json:"URL" yaml:"URL"`
		User string `json:"User" yaml:"User"`
		Pass string `json:"Pass" yaml:"Pass"`
	} `json:"SUI" yaml:"SUI"`

	DIContainer *di.Container
}

type ConfCommonData

type ConfCommonData struct {
	BinPath string
	OutDir  string
	Version string
	// contains filtered or unexported fields
}

func (*ConfCommonData) BuildExtensions

func (conf *ConfCommonData) BuildExtensions(chExt chan<- IConfiguration, chError chan<- error, extNames extNames, beforeBuild func(IConfiguration)) (errOut error)

func (*ConfCommonData) CreateTmpBD

func (conf *ConfCommonData) CreateTmpBD() (result string, err error)

CreateTmpBD метод создает временную базу данных

func (*ConfCommonData) GetExtensions

func (conf *ConfCommonData) GetExtensions() []IConfiguration

func (*ConfCommonData) GetReport

func (this *ConfCommonData) GetReport(report string) (result []*RepositoryInfo, err error)

func (*ConfCommonData) InitExtensions

func (conf *ConfCommonData) InitExtensions(rootDir, outDir string)

InitExtensions - находит расширения в каталоге

func (*ConfCommonData) New

func (this *ConfCommonData) New(Confs *CommonConf) *ConfCommonData

func (*ConfCommonData) ReadVervionFromConf

func (conf *ConfCommonData) ReadVervionFromConf(cfPath string) (err error)

func (*ConfCommonData) SaveConfiguration

func (conf *ConfCommonData) SaveConfiguration(rep *Repository, revision int) (result string, errOut error)

func (*ConfCommonData) SaveReport

func (conf *ConfCommonData) SaveReport(rep *Repository, versionStart int, versionFinish int) (result string, errOut error)

type Extension

type Extension struct {
	Base    string `json:"Base" yaml:"Base"`
	Name    string `json:"Name" yaml:"Name"`
	Version string `json:"Version" yaml:"Version"`

	ConfigurationFile string
	GUID              string `json:"GUID" yaml:"GUID"`
	// contains filtered or unexported fields
}

func (*Extension) Create

func (this *Extension) Create(rootDir string) bool

Create - Создание и инициализация структуры

func (*Extension) GetFile

func (this *Extension) GetFile() string

func (*Extension) GetFilesDir

func (this *Extension) GetFilesDir() string

func (*Extension) GetID

func (this *Extension) GetID() string

func (*Extension) GetName

func (this *Extension) GetName() string

func (*Extension) IncVersion

func (this *Extension) IncVersion() (err error)

func (*Extension) IsExtension

func (this *Extension) IsExtension() bool

type Fresh

type Fresh struct {
	URL      string            `json:"URL" yaml:"URL"`
	Login    string            `json:"Login" yaml:"Login"`
	Pass     string            `json:"Pass" yaml:"Pass"`
	Services map[string]string `json:"Services" yaml:"Services"`
}

func (*Fresh) GetLogin

func (f *Fresh) GetLogin() string

////////////// Fresh ///////////////////////

func (*Fresh) GetPass

func (f *Fresh) GetPass() string

func (*Fresh) GetService

func (f *Fresh) GetService(name string) string

type FreshConf

type FreshConf struct {
	Name  string `json:"Name" yaml:"Name"`
	Alias string `json:"Alias" yaml:"Alias"`
	SM    *Fresh `json:"SM" yaml:"SM"`
	SA    *Fresh `json:"SA" yaml:"SA"`
}

type IConfiguration

type IConfiguration interface {
	IsExtension() bool
	GetName() string
	GetID() string
	GetFilesDir() string
	GetFile() string
	IncVersion() error
}

type IFreshAuth

type IFreshAuth interface {
	GetLogin() string
	GetPass() string
	GetService(string) string
}

type Repository

type Repository struct {
	Path          string `json:"Path" yaml:"Path"`
	Alias         string `json:"Alias" yaml:"Alias"`
	ConfFreshName string `json:"ConfFreshName" yaml:"ConfFreshName"`
	Name          string `json:"Name" yaml:"Name"`
	Login         string `json:"Login" yaml:"Login"`
	Pass          string `json:"Pass" yaml:"Pass"`
}

type RepositoryInfo

type RepositoryInfo struct {
	Version int
	Author  string
	Date    time.Time
	Comment string
}

Jump to

Keyboard shortcuts

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