config

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: BSD-2-Clause Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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