config

package
v0.0.0-...-126a197 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	App struct {
		ID     string `yaml:"id"`
		Name   string `yaml:"name"`
		Remote string `yaml:"remote"`
	} `yaml:"app"`
	CSR        string `yaml:"request.csr"`
	PublicKey  string `yaml:"client.crt"`
	PrivateKey string `yaml:"client.key"`
	ServerCert string `yaml:"server.crt"`
}

Config holds the config for the app

func New

func New() Config

New reads or creates a new config. If a config file is in place it will always return the files contents

func (*Config) CertExists

func (cfg *Config) CertExists() bool

CertExists certificate exists and can be used

func (*Config) GenerateKeysAndCertificate

func (cfg *Config) GenerateKeysAndCertificate(subject string) *certificate.CACertificate

GenerateKeysAndCertificate generates keys and certificates

func (*Config) UpdateAppID

func (cfg *Config) UpdateAppID(id string)

UpdateAppID updates the app config with the App ID received from remote and calls saveConfig().

func (*Config) UpdateRemote

func (cfg *Config) UpdateRemote(remoteURL string)

UpdateRemote updates the app config with the metadata url received from the connect application respsonse and calls saveConfig().

func (*Config) UpdateServerCert

func (cfg *Config) UpdateServerCert(certData string)

UpdateServerCert updates the app config with the certificate received from remote and calls saveConfig().

Jump to

Keyboard shortcuts

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