utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
View Source
const Mark = `+----------------------+------------------------------------------+`

Variables

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

These variables are populated via the Go linker.

Functions

func AgentGet

func AgentGet() *gorequest.SuperAgent

func CookieClean

func CookieClean()

CookieClean removes .cookie.yaml file entirely.

This function is called only in stage of logout.

func CookieFilter

func CookieFilter(cookies []*http.Cookie, filter string) (string, error)

CookieFilter filters specific cookie string.

func CookieLoad

func CookieLoad() (string, error)

CookieLoad loads beegosessionID from .cookie.yaml.

func CookieSave

func CookieSave(beegosessionID string) error

CookieSave saves beegosessionID into .cookie.yaml .

This function is called only in stage of login, and will reset the content of .cookie.yaml no matter whether it exists or not.

func Delete

func Delete(targetURL string)

func Get

func Get(targetURL string)

func GetStruct added in v0.15.0

func GetStruct(targetURL string, st interface{})
func Head(targetURL string)

func Multipart added in v0.12.0

func Multipart(targetURL string, files ...string)

func Post

func Post(targetURL string, body string)

func Put

func Put(targetURL string, body string)

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

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

Beegocookie is for beegosessionID storage

type SysConfig

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