Documentation ¶
Overview ¶
Package geneos provides internal features to manage a typical `Best Practice` installation layout and the conventions that have formed around that structure over many years.
Index ¶
- Constants
- Variables
- func CleanRelativePath(p string) (clean string, err error)
- func CompareVersion(version1, version2 string) int
- func CurrentVersion(h *Host, ct *Component, base string) (version string, err error)
- func DecomposePEM(data ...string) (cert *x509.Certificate, der *memguard.Enclave, chain []*x509.Certificate, ...)
- func FilenameFromHTTPResp(resp *http.Response, u *url.URL) (filename string, err error)
- func ImportCommons(r *Host, ct *Component, common string, params []string) (filenames []string, err error)
- func ImportSharedKey(h *Host, ct *Component, source string, prompt ...string) (paths []string, crc uint32, err error)
- func ImportSource(h *Host, dest string, source string) (filename string, err error)
- func Init(app string)
- func InitHosts(app string)
- func Initialise(h *Host, options ...PackageOptions) (err error)
- func Install(h *Host, ct *Component, options ...PackageOptions) (err error)
- func InstalledReleases(h *Host, ct *Component) (versions []string, err error)
- func KeyFileNormalise(in string) (out string)
- func LoadHostConfig()
- func LocalArchives(ct *Component, options ...PackageOptions) (archives []string, err error)
- func LocalRoot() string
- func PlatformID(h *Host) (platformID string)
- func ReadAll(source string) (b []byte, err error)
- func ReadKeyValues(source string, prompt ...string) (kv *config.KeyValues, err error)
- func ReadRootCert(verify ...bool) (cert *x509.Certificate, file string, err error)
- func ReadSigningCert(verify ...bool) (cert *x509.Certificate, file string, err error)
- func SaveConfig(execname string) error
- func SaveHostConfig() error
- func TLSImportBundle(signingBundleSource, privateKeySource, chainSource string) (err error)
- func TLSInit(overwrite bool, keytype string) (err error)
- func TLSSync() (err error)
- func Update(h *Host, ct *Component, options ...PackageOptions) (err error)
- func WriteChainLocal(chain []*x509.Certificate) (err error)
- func WriteSharedKeyValues(h *Host, ct *Component, kv *config.KeyValues) (paths []string, crc uint32, err error)
- type Component
- func AllComponents() (cts []*Component)
- func FilenameToComponentVersion(oct *Component, filename string) (ct *Component, version, platform, suffix string, err error)
- func OverrideToComponentVersion(override string) (ct *Component, version string, err error)
- func ParseComponent(component string) *Component
- func RealComponents() (cts []*Component)
- func UsesKeyFiles() (cts []*Component)
- func (ct *Component) InstancesBaseDirs(h *Host) (dirs []string)
- func (ct *Component) InstancesDir(h *Host) (dir string)
- func (ct *Component) IsA(names ...string) bool
- func (ct *Component) KeyFilePath(h *Host, keyfile config.KeyFile, keycrc string) (path string, err error)
- func (ct *Component) MakeDirs(h *Host) (err error)
- func (ct *Component) OrList(cts ...*Component) []*Component
- func (ct *Component) Register(factory func(string) Instance)
- func (ct *Component) Shared(h *Host, subs ...interface{}) string
- func (ct *Component) String() (name string)
- type DownloadBases
- type FileOwner
- type Host
- func (h *Host) Delete()
- func (h *Host) Exists() bool
- func (h *Host) FullName(name string) string
- func (h *Host) GetFileOwner(info fs.FileInfo) (s FileOwner)
- func (h *Host) Hidden() bool
- func (h *Host) OrList(hosts ...*Host) []*Host
- func (h *Host) PathTo(parts ...interface{}) string
- func (h *Host) SetOSReleaseEnv() (err error)
- func (h *Host) String() string
- func (h *Host) Valid()
- type Instance
- type KeyStore
- type PackageOptions
- func Basename(basename string) PackageOptions
- func DoUpdate(update bool) PackageOptions
- func DownloadOnly(download bool) PackageOptions
- func Force(force bool) PackageOptions
- func LocalArchive(path string) PackageOptions
- func LocalOnly(local bool) PackageOptions
- func NoSave(nosave bool) PackageOptions
- func OverrideVersion(version string) PackageOptions
- func Password(password *config.Plaintext) PackageOptions
- func Restart(instance ...Instance) PackageOptions
- func SetPlatformID(platform string) PackageOptions
- func StartFunc(fn func(Instance, ...any) error) PackageOptions
- func StopFunc(fn func(Instance, bool, bool) error) PackageOptions
- func UseNexus() PackageOptions
- func UseNexusSnapshots() PackageOptions
- func UseRoot(root string) PackageOptions
- func Username(username string) PackageOptions
- func Version(version string) PackageOptions
- type ReleaseDetails
- type Templates
Constants ¶
const ( LOCALHOST = "localhost" ALLHOSTS = "all" UNKNOWNHOST = "UNKNOWN" )
Default host labels that always exist
const DisableExtension = "disabled"
DisableExtension is the suffix added to instance config files to mark them disabled
const OldUserHostFile = "geneos-hosts.json"
OldUserHostFile is a legacy name that will be deprecated in the future
const RootComponentName = "root"
Variables ¶
var ( ErrRootNotSet = errors.New("root directory not set") ErrInvalidArgs = errors.New("invalid arguments") ErrNotSupported = errors.New("not supported") ErrIsADirectory = errors.New("is a directory") ErrExists = errors.New("exists") ErrNotExist = errors.New("does not exist") ErrDisabled = errors.New("instance is disabled") ErrProtected = errors.New("instance is protected") ErrRunning = errors.New("instance is running") ErrNotRunning = errors.New("instance is not running") )
Useful errors for the package to return
Can also be used by other packages
var ChainCertFile string
ChainCertFile the is file name (including extension, as this does not need to be used for keys) for the consolidated chain file used to verify instance certificates
var RootCABasename = "rootCA"
RootCABasename is the file base name for the root certificate authority created with the TLS commands
var RootComponent = Component{ Name: RootComponentName, PackageTypes: nil, Aliases: []string{"any"}, DownloadBase: DownloadBases{Default: "", Nexus: ""}, GlobalSettings: map[string]string{ "download::url": defaultURL, "reservednames": "all", "privatekeys": "id_rsa,id_ecdsa,id_ecdsa_sk,id_ed25519,id_ed25519_sk,id_dsa", // contains filtered or unexported fields }, Directories: []string{ "packages/downloads", }, }
var SigningCertBasename string
SigningCertBasename is the file base name for the signing certificate created with the TLS commands
Functions ¶
func CleanRelativePath ¶ added in v1.5.0
CleanRelativePath given a path returns a cleaned version. If the cleaning results in an absolute path or one that tries to ascend the tree then return an error
func CompareVersion ¶ added in v1.5.0
CompareVersion takes two Geneos package versions and returns an int that is 0 if they are identical, negative if version1 < version2 and positive is version1 > version2. If the version is prefixed with non numeric values then "GA" is always greater thn "RA" (general versus restricted availability) for the same numeric version, otherwise a lexical comparison is done on the prefixes.
If either version is empty or unparseable then the return value is set to favour the other version - or 0 if both are empty strings.
func CurrentVersion ¶ added in v1.6.0
CurrentVersion returns the version that base points to for the component ct on host h. If base is not a symlink then it is returned unchanged. Returns version set to "unknown" on error.
func DecomposePEM ¶ added in v1.13.0
func DecomposePEM(data ...string) (cert *x509.Certificate, der *memguard.Enclave, chain []*x509.Certificate, err error)
DecomposePEM parses PEM formatted data and extracts the leaf certificate, any CA certs as a chain and a private key as a DER encoded *memguard.Enclave. The key is matched to the leaf certificate.
func FilenameFromHTTPResp ¶
FilenameFromHTTPResp decodes and returns the filename from the HTTP(S) request. It tried to extract the filename from the COntent-Disposition header and if that fails returns the basename of the URL Path.
func ImportCommons ¶ added in v1.7.0
func ImportCommons(r *Host, ct *Component, common string, params []string) (filenames []string, err error)
ImportCommons copies a file to an instance common directory.
func ImportSharedKey ¶ added in v1.10.4
func ImportSharedKey(h *Host, ct *Component, source string, prompt ...string) (paths []string, crc uint32, err error)
ImportSharedKey writes the contents of source to a shared keyfile on host h, component type ct. Host can be `ALL` and ct can be nil, in which case they are treated as wildcards. keyfile can be a local file ("~/" relative to user home), a remote URL or "-" for STDIN.
func ImportSource ¶ added in v1.19.0
ImportSource copies the contents from source to the destination dest on host h. The destination filename can be given as a "NAME=" prefix in source. If no filename is given then it is derived from the source.
source can be a path to a file or a http/https URL.
If source is a local file and it is the same as the destination then an ErrExists is returned.
If source is a local directory then it is copied to dest only if dest is a directory or does not exist and a directory with that name can be created. If source ends with a '/' then the contents are copied without the source directory prefix, otherwise the final directory component in source is also copied, e.g. 'conf/' means import the contents of the directory 'conf', which 'conf' means a new directory 'conf' is created in dest and the contents copied.
TODO: add templating option - perhaps ImportFileTemplated() - to run through text/template with given data (probabl instance config)
func InitHosts ¶ added in v1.5.0
func InitHosts(app string)
InitHosts initialises the host settings and is only called from the root command to set the initial values of host.LOCAL and host.ALL and reads the host configuration file. LOCAL and ALL cannot be initialised outside a function as there would be a definition loop.
func Initialise ¶ added in v1.5.0
func Initialise(h *Host, options ...PackageOptions) (err error)
Initialise a Geneos environment by creating a directory structure and then it calls the initialisation functions for each component type registered.
If the directory is not empty and the Force() option is not passed then nothing is changed
func Install ¶
func Install(h *Host, ct *Component, options ...PackageOptions) (err error)
Install a Geneos software release. The destination host h and the component type ct must be given. options controls behaviour like local only and restarts of affected instances.
func InstalledReleases ¶ added in v1.17.0
InstalledReleases returns a sorted slice of all the installed version of component ct on host h as strings. No filtering is done for platform ID etc. as these are already installed on theo host given.
func KeyFileNormalise ¶ added in v1.7.0
KeyFileNormalise returns the input in for format "DIR/HEX.aes" where HEX is an 8 hexadecimal digit string in uppercase and DIR is any leading path before the file name. If the input is neither an 8 digit hex string (in upper or lower case) with or without the extension ".aes" (in upper or lower case) then the input is returned unchanged.
func LoadHostConfig ¶ added in v1.5.0
func LoadHostConfig()
LoadHostConfig loads configuration entries from the host configuration file.
func LocalArchives ¶ added in v1.17.0
func LocalArchives(ct *Component, options ...PackageOptions) (archives []string, err error)
LocalArchives returns a slice of file names for release archives for component ct in the location given by options or the default packages download directory. If a platform ID is set using options then include those otherwise only non-platform specific releases are included.
func LocalRoot ¶ added in v1.11.1
func LocalRoot() string
LocalRoot return the absolute path to the local Geneos installation. If run on an older installation it may return the value from the legacy configuration item `itrshome` if `geneos` is not set.
func PlatformID ¶
PlatformID returns the platform ID for the host h.
func ReadAll ¶ added in v1.16.0
ReadAll opens and, if successful, reads the contents of the source passed, returning a byte slice of the contents or an error. source can be a local file or a URL. While ReadAll calls the internal openSourceFile(), no options are supported
func ReadKeyValues ¶ added in v1.13.0
ReadKeyValues returns a memguard enclave in kv containing the key values from the source. `source` can be a path to a file, a `-` for STDIN (in which case an optional prompt is output) or a remote URL.
func ReadRootCert ¶ added in v1.13.0
func ReadRootCert(verify ...bool) (cert *x509.Certificate, file string, err error)
ReadRootCert reads the root certificate from the user's app config directory. It "promotes" old cert and key files from the previous tls directory if files do not already exist in the user app config directory. If verify is true then the certificate is verified against itself as a root and if it fails an error is returned.
func ReadSigningCert ¶ added in v1.13.0
func ReadSigningCert(verify ...bool) (cert *x509.Certificate, file string, err error)
ReadSigningCert reads the signing certificate from the user's app config directory. It "promotes" old cert and key files from the previous tls directory if files do not already exist in the user app config directory. If verify is true then the signing certificate is checked and verified against the default root certificate.
func SaveConfig ¶ added in v1.15.1
SaveConfig saves the global configuration (in config.Global) but excludes any values that still have their defaults, by iterating through registered components and checking.
func SaveHostConfig ¶ added in v1.5.0
func SaveHostConfig() error
SaveHostConfig writes the current hosts to the users hosts configuration file
func TLSImportBundle ¶ added in v1.13.0
func TLSInit ¶ added in v1.13.0
create the tls/ directory in Geneos and a CA / DCA as required
later options to allow import of a DCA
This is also called from `init`
func TLSSync ¶ added in v1.13.0
func TLSSync() (err error)
TLSSync creates and copies a certificate chain file to all remote hosts
If a signing cert and/or a root cert exist, refresh the chain file from it, otherwise copy the chain file (using the configured name) to all remotes.
func Update ¶
func Update(h *Host, ct *Component, options ...PackageOptions) (err error)
Update will check and update the base link given in the options. If the base link exists then the force option must be used to update it, otherwise it is created as expected. When called from unarchive() this allows new installs to work without explicitly calling update.
func WriteChainLocal ¶ added in v1.13.0
func WriteChainLocal(chain []*x509.Certificate) (err error)
func WriteSharedKeyValues ¶ added in v1.13.0
func WriteSharedKeyValues(h *Host, ct *Component, kv *config.KeyValues) (paths []string, crc uint32, err error)
WriteSharedKeyValues writes key values kv to the host h and component type ct shared directory in a file `CRC.aes`. Host can be ALL and ct can be nil, in which case they are treated as wildcards.
Types ¶
type Component ¶
type Component struct { // Name of a component Name string // Aliases are any names for the component (including the Name, above) Aliases []string // LegacyPrefix is the three or four letter prefix from legacy `ctl` // commands LegacyPrefix string // LegacyParameters is a map of legacy parameters (including prefix) // to new parameter names LegacyParameters map[string]string // ParentType, if set, is the parent component that the component is // under, e.g. 'fa2' has a parent of 'netprobe'. See PackageTypes // below. ParentType *Component // PackageTypes is a list of packages that can be used to support // this component. For example, a 'san' could be either a plain // 'netprobe' or an 'fa2'. The entries must reference components // that do not have PackageTypes set to avoid recursion. PackageTypes []*Component // DownloadBase lists, for each download source, the path to append // to the download URL (without any query string) DownloadBase DownloadBases // DownloadInfix is the component name in the downloaded file and if // set replace this string with component name for download matches, // e.g. `geneos-["desktop-activeconsole"]-VERSION...` -> `ac2` DownloadInfix string // DownloadNameRegexp is a custom regular expression to extract // archive information from the download file DownloadNameRegexp *regexp.Regexp // DownloadParams are custom parameters for the download URL. If nil // (not len zero) then os=linux is used DownloadParams *[]string // DownloadParamsNexus are custom parameters for Nexus downloads. If // nil then the defaults are: // // maven.classifier=linux-x64 // maven.extension=tar.gz // maven.groupId=com.itrsgroup.geneos DownloadParamsNexus *[]string ArchiveLeaveFirstDir bool // Defaults are name=value templates that are "run" for each new // instance // // They are run in order, as later defaults may depend on earlier // settings, and so this cannot be a map Defaults []string UsesKeyfiles bool // Directories to be created (under Geneos home) on initialisation Directories []string // Templates are any templates for the component. Each Template has // a filename and default content Templates []Templates GlobalSettings map[string]string PortRange string CleanList string PurgeList string // ConfigAliases maps new configuration parameters to the original // names, e.g. "netprobe::ports" -> "netprobeportrange" // // We can use this to support older geneos.json config while // migrating ConfigAliases map[string]string // Initialise a component. Callback after the component is registered Initialise func(*Host, *Component) // New is the factory method for the component. It has to be added // during initialisation to avoid loops New func(string) Instance // GetPID returns the process ID of an instance - if nil a standard // function is used GetPID func(arg any, cmdline ...[]byte) bool // if set, use this to get the PID of an instance }
Component defines a registered component
func AllComponents ¶
func AllComponents() (cts []*Component)
AllComponents returns a slice of all registered components, include the Root component type
func FilenameToComponentVersion ¶ added in v1.16.0
func FilenameToComponentVersion(oct *Component, filename string) (ct *Component, version, platform, suffix string, err error)
FilenameToComponentVersion transforms an archive filename and returns the component and version or an error if the file format is not recognised
func OverrideToComponentVersion ¶ added in v1.16.0
func ParseComponent ¶ added in v1.7.0
ParseComponent returns the component type by iterating over all the names registered by components and returning as soon as any value matches. The comparison is case-insensitive. nil is returned if the component does not match any known name.
func RealComponents ¶
func RealComponents() (cts []*Component)
RealComponents returns a slice of all registered components that are not the root, sorted by name
func UsesKeyFiles ¶ added in v1.5.0
func UsesKeyFiles() (cts []*Component)
UsesKeyFiles returns a slice of registered components that use key files
func (*Component) InstancesBaseDirs ¶ added in v1.15.0
InstancesBaseDirs returns a list of possible instance directories to look for an instance.
func (*Component) InstancesDir ¶ added in v1.4.1
InstancesDir return the parent directory for the instances of a component
func (*Component) IsA ¶ added in v1.5.0
IsA returns true is any of the names match the any of the names defined in ComponentMatches. The check is case-insensitive.
func (*Component) KeyFilePath ¶ added in v1.11.0
func (ct *Component) KeyFilePath(h *Host, keyfile config.KeyFile, keycrc string) (path string, err error)
KeyFilePath returns the absolute path to either the given keyfile or a shared keyfile with the CRC of keycrc, if keyfile is not set. If ct is nil then the first matching keyfile from all components is returned. If h is ALL then only localhost is checked.
func (*Component) MakeDirs ¶ added in v1.7.0
MakeDirs creates the directory structure for the component ct. If ct is nil then the Root component type is used. If there is an error creating the directory then the error is immediately returned and the list of directories may only be partially created.
func (*Component) OrList ¶ added in v1.5.0
OrList will return the method receiver, if not nil, or the list of component types passed as args. If no arguments are passed then all non-root components are returned.
func (*Component) Register ¶ added in v1.7.0
Register adds the given Component ct to the internal list of component types. The factory parameter is the Component's New() function, which has to be passed in to avoid initialisation loops as the function refers to the type being registered.
type DownloadBases ¶
DownloadBases define the base names for the download archived for standard and nexus downloads
type Host ¶ added in v1.5.0
Host defines a host for seamless remote management
LOCAL and ALL are the global Host values that represent LOCALHOST and ALLHOSTS from above, and must always exist
func AllHosts ¶ added in v1.5.0
func AllHosts() (hs []*Host)
AllHosts returns a slice of all hosts, including LOCAL
func GetHost ¶ added in v1.5.0
GetHost returns a pointer to Host value. If passed an empty name, returns nil. If passed the special values LOCALHOST or ALLHOSTS then it will return the respective special values LOCAL or ALL. Otherwise it tries to lookup an existing host with the given name.
It will return UNKNOWN if the named host is not found. Use NewHost() to initialise a new host
func Match ¶ added in v1.5.0
Match returns a slice of all matching Hosts. Intended for use in range loops where the host could be specific or 'all'. If passed an empty string then returns an empty slice.
func NewHost ¶ added in v1.5.0
NewHost is a factory method for Host. It returns an initialised Host and will store it in the global map. If name is "localhost" or "all" or "unknown" then it returns pseudo-hosts used for testing and ranges.
func RemoteHosts ¶ added in v1.5.0
RemoteHosts returns a slice of all valid (loaded and reachable) remote hosts sorted by name
func (*Host) Delete ¶ added in v1.5.0
func (h *Host) Delete()
Delete host h from the internal list of hosts. Does not change the on-disk configuration file
func (*Host) Exists ¶ added in v1.5.0
Exists returns true if the host h has an initialised configuration
To check is a host can be contacted use the IsAvailable() instead
func (*Host) FullName ¶ added in v1.5.0
FullName returns name with the host h label appended if there is no existing host label in the form `instance@host`. Any existing label is not checked or changed.
func (*Host) GetFileOwner ¶ added in v1.5.0
func (*Host) OrList ¶ added in v1.5.0
OrList will return the receiver unless it is nil, or the list of all hosts passed as args. If no args are given and the receiver is nil then all hosts are returned.
func (*Host) PathTo ¶ added in v1.7.0
PathTo builds an absolute path based on the Geneos root of the host h (using the executable name as the key) and the parts passed as arguments. Each part can be a pointer to a geneos.Component, in which case the component name or the parent component name is used, or any other type is passed to fmt.Sprint to be stringified. The path is returned from path.Join
If calling this against the "packages" directory remember to use ct.String() to not deference the parent type, which is done if a part is a *Component
func (*Host) SetOSReleaseEnv ¶ added in v1.5.0
SetOSReleaseEnv sets the `osinfo` configuration map to the values from either `/etc/os-release` (or `/usr/lib/os-release`) on Linux or simulates the values for Windows
type Instance ¶
type Instance interface { Config() *config.Config // Name returns the base instance name Name() string // Home returns the path to the instance directory Home() string // Type returns a Component type for the instance Type() *Component // Host returns the Host for the instance Host() *Host // String returns the display name of the instance in the form `TYPE // NAME` for local instances and `TYPE NAME@HOST` for those on // remote hosts String() string // config Load() error Unload() error Loaded() time.Time SetLoaded(time.Time) // actions Add(template string, port uint16) error Command() ([]string, []string, string) Reload() (err error) Rebuild(bool) error }
Instance interfaces contains the method set for an instance of a registered Component
type KeyStore ¶ added in v1.13.0
type KeyStore struct {
keystore.KeyStore
}
func ReadKeystore ¶ added in v1.13.0
OpenKeystore returns a keystore
func (*KeyStore) AddKeystoreCert ¶ added in v1.13.0
func (k *KeyStore) AddKeystoreCert(alias string, cert *x509.Certificate) (err error)
func (*KeyStore) AddKeystoreKey ¶ added in v1.13.0
type PackageOptions ¶ added in v1.15.0
type PackageOptions func(*geneosOptions)
PackageOptions can be passed to various function and influence behaviour related to download, unpacking and using release packages
func Basename ¶
func Basename(basename string) PackageOptions
Basename sets the package binary basename, defaults to active_prod, for symlinks for update.
func DoUpdate ¶ added in v1.4.1
func DoUpdate(update bool) PackageOptions
DoUpdate sets the option to also do an update after an install
func DownloadOnly ¶ added in v1.6.6
func DownloadOnly(download bool) PackageOptions
DownloadOnly prevents the unarchiving of the selected packages. Downloads are stored in the directory given to Source() or the default `packages/download` directory. NoSave and DownloadOnly are mutually exclusive.
func Force ¶
func Force(force bool) PackageOptions
Force ignores existing directories or files and also overrides protection for running instances in upgrades
func LocalArchive ¶ added in v1.15.0
func LocalArchive(path string) PackageOptions
LocalArchive is the local archive location or the specific release file. It can be a directory, in which case that directory is used for the appropriate archive file(s)
func LocalOnly ¶
func LocalOnly(local bool) PackageOptions
LocalOnly uses only existing archives and prevents attempts to download releases
func NoSave ¶
func NoSave(nosave bool) PackageOptions
NoSave stops downloads from being saved in the archive directory. NoSave and DownloadOnly are mutually exclusive.
func OverrideVersion ¶
func OverrideVersion(version string) PackageOptions
OverrideVersion forces a specific version to be used and fails if not available
func Password ¶
func Password(password *config.Plaintext) PackageOptions
Password is the remote access password for downloads
func Restart ¶
func Restart(instance ...Instance) PackageOptions
Restart sets the instances to be restarted around the update
func SetPlatformID ¶ added in v1.17.0
func SetPlatformID(platform string) PackageOptions
SetPlatformID sets the (Linux) platform ID from the OS release info. Currently used to distinguish RHEL8/9 releases from others.
func StartFunc ¶ added in v1.8.1
func StartFunc(fn func(Instance, ...any) error) PackageOptions
StartFunc sets the start function to call for each instance given in Restart(). It is required to avoid import loops.
func StopFunc ¶ added in v1.8.1
func StopFunc(fn func(Instance, bool, bool) error) PackageOptions
StopFunc sets the start function to call for each instance given in Restart(). It is required to avoid import loops.
func UseNexus ¶
func UseNexus() PackageOptions
UseNexus sets the flag to use nexus.itrsgroup.com for internal downloads instead of the default download URL in the settings. This also influences the way the remote path is searched and build, not just the base URL.
func UseNexusSnapshots ¶ added in v1.15.0
func UseNexusSnapshots() PackageOptions
UseNexusSnapshots set the flag to use Nexus Snapshots rather than Releases.
func UseRoot ¶ added in v1.5.0
func UseRoot(root string) PackageOptions
UseRoot sets the Geneos installation home directory (aka `geneos` in the settings)
func Username ¶
func Username(username string) PackageOptions
Username is the remote access username for downloads
func Version ¶
func Version(version string) PackageOptions
Version sets the desired version number, defaults to "latest" in most cases. The version number is in the form `[GA]X.Y.Z` (or `RA` for snapshots)
type ReleaseDetails ¶ added in v1.5.0
type ReleaseDetails struct { Component string `json:"Component"` Host string `json:"Host"` Version string `json:"Version"` Latest bool `json:"Latest,string"` Links []string `json:"Links,omitempty"` ModTime time.Time `json:"LastModified"` Path string `json:"Path"` }
ReleaseDetails is a set of values for a release
func GetReleases ¶ added in v1.5.0
func GetReleases(h *Host, ct *Component) (releases []ReleaseDetails, err error)
GetReleases returns a slice of PackageDetails containing all the directories Geneos packages directory on the given host. Symlinks in the packages directory are matches to any targets and unmatched symlinks are ignored.
No validation is done on the contents, only that a directory exists.