config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultFile

func DefaultFile(name string) string

DefaultFile returns the default configuration file path

func ReadConfig

func ReadConfig(configFile, project string) error

ReadConfig reads configuration from a file

Types

type Project

type Project struct {
	Host         string
	ID           uint64
	RefreshToken string `mapstructure:"refresh_token" yaml:"refresh_token"`
	// contains filtered or unexported fields
}

Project represents a Flexera project/project

func (*Project) AppHost

func (p *Project) AppHost() string

AppHost returns the UI application host for a project

func (*Project) AuthHost

func (p *Project) AuthHost() string

AuthHost returns the authentication host for a project

func (*Project) GRSHost

func (p *Project) GRSHost() string

GRSHost returns the GRS host for a project

func (*Project) Validate

func (p *Project) Validate() error

Validate validates the host for a project

type Viper

type Viper struct {
	*viper.Viper
	Project  *Project
	Projects map[string]*Project
}

Viper wraps a Viper config with additional Flexera project/project information

var (
	// Config contains the configuration
	Config Viper
)

func (*Viper) GetProject

func (config *Viper) GetProject(id uint64, host string) (*Project, error)

GetProject returns the project for a given id and host

Jump to

Keyboard shortcuts

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