Documentation ¶
Overview ¶
package registration provides managed instance information
package registration provides managed instance information
Index ¶
- Constants
- func Fingerprint() (string, error)
- func GenerateKeyPair() (publicKey, privateKey, keyType string, err error)
- func HasManagedInstancesCredentials() (bool, error)
- func InstanceID() string
- func PrivateKey() string
- func Region() string
- func UpdatePrivateKey(privateKey, privateKeyType string) (err error)
- func UpdateServerInfo(instanceID, region, privateKey, privateKeyType string) (err error)
Examples ¶
Constants ¶
View Source
const (
RegVaultKey = "RegistrationKey"
)
Variables ¶
This section is empty.
Functions ¶
func GenerateKeyPair ¶
GenerateKeyPair generate a new keypair
func HasManagedInstancesCredentials ¶
HasManagedInstancesCredentials returns true when the valid registration information is present
func InstanceID ¶
func InstanceID() string
InstanceID of the managed instance.
Example ¶
file = fileStub{} vault = vaultStub{rKey: sampleRegistrationKey, data: sampleJson} loadServerInfo() // load info with mocked vault instanceID := InstanceID() fmt.Println(instanceID)
Output: mi-e6c6f145e6c6f145
func PrivateKey ¶
func PrivateKey() string
PrivateKey of the managed instance.
Example ¶
file = fileStub{} vault = vaultStub{rKey: sampleRegistrationKey, data: sampleJson} loadServerInfo() // load info with mocked vault privateKey := PrivateKey() fmt.Println(privateKey)
Output: KEYe6c6f145e6c6f145
func Region ¶
func Region() string
Region of the managed instance.
Example ¶
file = fileStub{} vault = vaultStub{rKey: sampleRegistrationKey, data: sampleJson} loadServerInfo() // load info with mocked vault region := Region() fmt.Println(region)
Output: us-west-1
func UpdatePrivateKey ¶
UpdatePrivateKey saves the private key into the registration persistance store
func UpdateServerInfo ¶
UpdateServerInfo saves the instance info into the registration persistance store
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.