utils

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2018 License: MIT Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UTCBuildTime  = "unknown"
	ClientVersion = "unknown"
	GoVersion     = "unknown"
	GitBranch     = "unknown"
	GitTag        = "unknown"
	GitHash       = "unknown"
)

These variables are populated via the Go linker.

View Source
var Parser = flags.NewParser(nil, flags.Default)

Parser is a command registry

View Source
var Request = gorequest.New().TLSClientConfig(&tls.Config{InsecureSkipVerify: true})

Request is a new SuperAgent object with a setting of not verifying server's certificate chain and host name.

Functions

func LoginProc

func LoginProc(resp gorequest.Response, body string, errs []error)

LoginProc is the callback function for login.

func LogoutProc

func LogoutProc(resp gorequest.Response, body string, errs []error)

LogoutProc is the callback function for logout.

func PrintLogo()

PrintLogo print logo.

func PrintStatus

func PrintStatus(resp gorequest.Response, body string, errs []error)

PrintStatus is a regular callback function.

func PrintVersion added in v0.5.0

func PrintVersion()

PrintVersion print version info.

func ReadPasswordFromTerm

func ReadPasswordFromTerm() (string, error)

ReadPasswordFromTerm gets user password from stdin without showing on screen

func URLGen

func URLGen(uri string) string

URLGen generates target URL.

Types

type Beegocookie added in v0.2.0

type Beegocookie struct {
	BeegosessionID string `yaml:"beegosessionID"`
}

Beegocookie is for beegosessionID storage

func CookieLoad

func CookieLoad() (*Beegocookie, error)

CookieLoad loads beegosessionID from .cookie.yaml.

type SysConfig added in v0.2.0

type SysConfig struct {
	AuthMode                   string `yaml:"auth_mode" json:"auth_mode"`
	EmailFrom                  string `yaml:"email_from" json:"email_from"`
	EmailHost                  string `yaml:"email_host" json:"email_host"`
	EmailPort                  int    `yaml:"email_port" json:"email_port"`
	EmailIdentity              string `yaml:"email_identity" json:"email_identity"`
	EmailUsername              string `yaml:"email_username" json:"email_username"`
	EmailSsl                   bool   `yaml:"email_ssl" json:"email_ssl"`
	EmailInsecure              bool   `yaml:"email_insecure" json:"email_insecure"`
	LdapURL                    string `yaml:"ldap_url" json:"ldap_url"`
	LdapBaseDN                 string `yaml:"ldap_base_dn" json:"ldap_base_dn"`
	LdapFilter                 string `yaml:"ldap_filter" json:"ldap_filter"`
	LdapScope                  int    `yaml:"ldap_scope" json:"ldap_scope"`
	LdapUID                    string `yaml:"ldap_uid" jsonb:"ldap_uid"`
	LdapSearchDN               string `yaml:"ldap_search_dn" json:"ldap_search_dn"`
	LdapTimeout                int    `yaml:"ldap_timeout" json:"ldap_timeout"`
	ProjectCreationRestriction string `yaml:"project_creation_restriction" json:"project_creation_restriction"`
	SelfRegistration           bool   `yaml:"self_registration" json:"self_registration"`
	TokenExpiration            int    `yaml:"token_expiration" json:"token_expiration"`
	VerifyRemoteCert           bool   `yaml:"verify_remote_cert" json:"verify_remote_cert"`
	ScanAllPolicy              struct {
		Type      string `yaml:"type" json:"type"`
		Parameter struct {
			DailyTime int `yaml:"daily_time" json:"daily_time"`
		} `yaml:"parameter" json:"parameter"`
	} `yaml:"scan_all_policy" json:"scan_all_policy"`
}

SysConfig defines system configurations

func SysConfigLoad

func SysConfigLoad() (*SysConfig, error)

SysConfigLoad loads system configuration from conf/config.yaml.

Directories

Path Synopsis
Package term provides structures and helper functions to work with terminal (state, sizes).
Package term provides structures and helper functions to work with terminal (state, sizes).

Jump to

Keyboard shortcuts

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