{"modulePath":"github.com/bigstack-oss/cube-advisor-agent","version":"v0.4.29","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package openstack\n\n## Constants\n\n```go\nconst OpenrcPath = \"/etc/admin-openrc.sh\"\n```\nOpenrcPath is CubeCOS's admin credential file.\n\n## Variables\n\n```go\nvar ErrUnknownService = errors.New(\"no such service in the catalogue\")\n```\nErrUnknownService is returned for a service type the catalogue lacks.\n\n## Types\n\n```go\ntype Admin struct {\n\tPath string\n\t// contains filtered or unexported fields\n}\n```\nAdmin holds a token for the node's admin credential and the catalogue it came with. The openrc file is re-read on each authentication.\n\n```go\nfunc NewAdmin(path string) *Admin\n```\nNewAdmin reads credentials from path on first use.\n\n```go\nfunc (a *Admin) Endpoint(ctx context.Context, service string) (string, string, error)\n```\nEndpoint returns the service's endpoint (internal before public) and a token to call it with.\n\n```go\nfunc (a *Admin) HTTP() *http.Client\n```\nHTTP returns a client trusting the openrc's CA, if it names one.\n\n```go\nfunc (a *Admin) Invalidate()\n```\nInvalidate drops the cached token, e.g. after a 401.\n\n```go\ntype Openrc struct {\n\tAuthURL, Username, Password, Project, UserDomain, ProjectDomain, CACert string\n}\n```\nOpenrc is the admin credential an openrc file exports.\n\n```go\nfunc ReadOpenrc(path string) (Openrc, error)\n```\nReadOpenrc reads the \\`export OS\\_\\*=value\\` lines of an openrc file. It does not run the file.\n\n```go\nfunc (o Openrc) GoString() string\n```\nGoString redacts under %#v too.\n\n```go\nfunc (o Openrc) String() string\n```\nString redacts the password.\n\n","path":"github.com/bigstack-oss/cube-advisor-agent/internal/openstack","name":"openstack","synopsis":"","isRedistributable":true}
