geneos

package
v1.0.1-pre Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DisableExtension = "disabled"
View Source
const GlobalConfigPath = "/etc/geneos/geneos.json"
View Source
const RootCAFile = "rootCA"
View Source
const SigningCertFile = "geneos"
View Source
const UserConfigFile = "geneos.json"

Variables

View Source
var (
	ErrInvalidArgs  error = errors.New("invalid arguments")
	ErrNotSupported error = errors.New("not supported")
	ErrDisabled     error = errors.New("disabled")
)

Functions

func FilenameFromHTTPResp

func FilenameFromHTTPResp(resp *http.Response, u *url.URL) (filename string, err error)

func Init

func Init(r *host.Host, options ...GeneosOptions) (err error)

initialise a Geneos environment.

creates a directory hierarchy and calls the initialisation functions for each component, for example to create templates

if the directory is not empty and 'noEmptyOK' is false then nothing is changed

func Install

func Install(r *host.Host, ct *Component, options ...GeneosOptions) (err error)

func MakeComponentDirs

func MakeComponentDirs(h *host.Host, ct *Component) (err error)

create any missing component registered directories

func MatchVersion

func MatchVersion(v string) bool

func OpenComponentArchive

func OpenComponentArchive(ct *Component, options ...GeneosOptions) (body io.ReadCloser, filename string, err error)

locate and return an open archive for the host and component given archives must be local

func OpenLocalFileOrURL

func OpenLocalFileOrURL(source string) (from io.ReadCloser, filename string, err error)

func ReadLocalConfigFile

func ReadLocalConfigFile(file string, config interface{}) (err error)

read a local configuration file without the need for a host connection, primarily for boostrapping

func ReadLocalFileOrURL

func ReadLocalFileOrURL(source string) (b []byte, err error)

func RegisterComponent

func RegisterComponent(ct *Component, n func(string) Instance)

register a component type

the factory function is an arg to disguise init cycles when you declare it in the struct in the caller

func Unarchive

func Unarchive(r *host.Host, ct *Component, filename string, gz io.Reader, options ...GeneosOptions) (err error)

func Update

func Update(h *host.Host, ct *Component, options ...GeneosOptions) (err error)

check selected version exists first

func UserConfigFilePath

func UserConfigFilePath() string

Types

type Component

type Component struct {
	Initialise       func(*host.Host, *Component)
	New              func(string) Instance
	Name             string
	RelatedTypes     []*Component
	ComponentMatches []string
	RealComponent    bool
	DownloadBase     DownloadBases
	PortRange        string
	CleanList        string
	PurgeList        string
	Aliases          map[string]string
	Defaults         []string // ordered list of key=value pairs
	GlobalSettings   map[string]string
	Directories      []string
}
var Root Component = Component{
	Name:             "none",
	RelatedTypes:     nil,
	ComponentMatches: []string{"all", "any"},
	RealComponent:    false,
	DownloadBase:     DownloadBases{Resources: "", Nexus: ""},
	GlobalSettings: map[string]string{

		"geneos": "",

		"download.url": "https://resources.itrsgroup.com/download/latest/",

		"defaultuser": "",

		"reservednames": "",

		"privatekeys": "id_rsa,id_ecdsa,id_ecdsa_sk,id_ed25519,id_ed25519_sk,id_dsa",
	},
	Directories: []string{
		"packages/downloads",
		"hosts",
	},
}

func AllComponents

func AllComponents() (cts []*Component)

func ParseComponentName

func ParseComponentName(component string) *Component

return the component type by iterating over all the names registered by components. case sensitive.

func RealComponents

func RealComponents() (cts []*Component)

currently supported real component types, for looping (go doesn't allow const slices, a function is the workaround)

func (*Component) ComponentDir

func (ct *Component) ComponentDir(h *host.Host) string

Return the base directory for a Component ct cannot be None

func (Component) RegisterDirs

func (ct Component) RegisterDirs(dirs []string)

register directories that need to be created in the root of the install (by init)

func (Component) String

func (ct Component) String() (name string)

type ComponentsMap

type ComponentsMap map[string]*Component

type DownloadBases

type DownloadBases struct {
	Resources string
	Nexus     string
}

type GeneosOptions

type GeneosOptions func(*Options)

func Basename

func Basename(b string) GeneosOptions

func Filename

func Filename(f string) GeneosOptions

func Force

func Force(o bool) GeneosOptions

func Homedir

func Homedir(h string) GeneosOptions

func LocalOnly

func LocalOnly(l bool) GeneosOptions

func NoSave

func NoSave(n bool) GeneosOptions

func OverrideVersion

func OverrideVersion(s string) GeneosOptions

func Password

func Password(p string) GeneosOptions

func PlatformID

func PlatformID(id string) GeneosOptions

func Restart

func Restart(r bool) GeneosOptions

func UseNexus

func UseNexus() GeneosOptions

func UseSnapshots

func UseSnapshots() GeneosOptions

func Username

func Username(u string) GeneosOptions

func Version

func Version(v string) GeneosOptions

type Instance

type Instance interface {
	// getters and setters
	Name() string
	Home() string
	Type() *Component
	Host() *host.Host
	Prefix() string
	String() string

	// config
	Load() error
	Unload() error
	Loaded() bool
	V() *viper.Viper
	SetConf(*viper.Viper)

	// actions
	Add(string, string, uint16) error
	Command() ([]string, []string)
	Reload(params []string) (err error)
	Rebuild(bool) error
}

type Options

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

func EvalOptions

func EvalOptions(options ...GeneosOptions) (d *Options)

func (*Options) Restart

func (d *Options) Restart() bool

Jump to

Keyboard shortcuts

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