config

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigDirName   = "/.deepsource/"
	ConfigFileName  = "/config.toml"
	DefaultHostName = "deepsource.io"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIConfig

type CLIConfig struct {
	Host           string    `toml:"host"`
	User           string    `toml:"user"`
	Token          string    `toml:"token"`
	TokenExpiresIn time.Time `toml:"token_expires_in,omitempty"`
}
var Cfg CLIConfig

func GetConfig

func GetConfig() (*CLIConfig, error)

func (*CLIConfig) Delete

func (cfg *CLIConfig) Delete() error

Deletes the config during logging out user

func (CLIConfig) IsExpired

func (cfg CLIConfig) IsExpired() bool

Checks if the token has expired or not

func (*CLIConfig) ReadConfigFile

func (cfg *CLIConfig) ReadConfigFile() error

ReadFile reads the CLI config file.

func (*CLIConfig) SetTokenExpiry

func (cfg *CLIConfig) SetTokenExpiry(str string)

Sets the token expiry in the desired format Sets the token expiry in the desired format

func (*CLIConfig) VerifyAuthentication

func (cfg *CLIConfig) VerifyAuthentication() error

func (*CLIConfig) WriteFile

func (cfg *CLIConfig) WriteFile() error

WriteFile writes the CLI config to file.

Jump to

Keyboard shortcuts

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