Documentation
¶
Index ¶
- Constants
- Variables
- func FilenameFromHTTPResp(resp *http.Response, u *url.URL) (filename string, err error)
- func Init(r *host.Host, options ...GeneosOptions) (err error)
- func Install(r *host.Host, ct *Component, options ...GeneosOptions) (err error)
- func MakeComponentDirs(h *host.Host, ct *Component) (err error)
- func MatchVersion(v string) bool
- func OpenComponentArchive(ct *Component, options ...GeneosOptions) (body io.ReadCloser, filename string, err error)
- func OpenLocalFileOrURL(source string) (from io.ReadCloser, filename string, err error)
- func ReadLocalConfigFile(file string, config interface{}) (err error)
- func ReadLocalFileOrURL(source string) (b []byte, err error)
- func RegisterComponent(ct *Component, n func(string) Instance)
- func Unarchive(r *host.Host, ct *Component, filename string, gz io.Reader, ...) (err error)
- func Update(h *host.Host, ct *Component, options ...GeneosOptions) (err error)
- func UserConfigFilePath() string
- type Component
- type ComponentsMap
- type DownloadBases
- type GeneosOptions
- func Basename(b string) GeneosOptions
- func Filename(f string) GeneosOptions
- func Force(o bool) GeneosOptions
- func Homedir(h string) GeneosOptions
- func LocalOnly(l bool) GeneosOptions
- func NoSave(n bool) GeneosOptions
- func OverrideVersion(s string) GeneosOptions
- func Password(p string) GeneosOptions
- func PlatformID(id string) GeneosOptions
- func Restart(r bool) GeneosOptions
- func UseNexus() GeneosOptions
- func UseSnapshots() GeneosOptions
- func Username(u string) GeneosOptions
- func Version(v string) GeneosOptions
- type Instance
- type Options
Constants ¶
const DisableExtension = "disabled"
const GlobalConfigPath = "/etc/geneos/geneos.json"
const RootCAFile = "rootCA"
const SigningCertFile = "geneos"
const UserConfigFile = "geneos.json"
Variables ¶
Functions ¶
func FilenameFromHTTPResp ¶
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 MakeComponentDirs ¶
create any missing component registered directories
func MatchVersion ¶
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 ¶
read a local configuration file without the need for a host connection, primarily for boostrapping
func ReadLocalFileOrURL ¶
func RegisterComponent ¶
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 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 ¶
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 ¶
Return the base directory for a Component ct cannot be None
func (Component) RegisterDirs ¶
register directories that need to be created in the root of the install (by init)
type ComponentsMap ¶
type DownloadBases ¶
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)