common

package
v0.0.0-...-21ca16f Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: LGPL-2.1 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GITHUB = OAuthType{
		UrlType: "github",
		// contains filtered or unexported fields
	}
)

Functions

func GetUserInfo

func GetUserInfo(OAuthType OAuthType, token *Token) (map[string]interface{}, error)

Types

type HeaderSet

type HeaderSet func(header http.Header)

type Monitor

type Monitor struct {
	CpuProportion float64
	MemProportion float64
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor() *Monitor

func (*Monitor) GetMonitorItemInfo

func (c *Monitor) GetMonitorItemInfo() (cpu float64, mem float64)

func (*Monitor) MonitorFunc

func (c *Monitor) MonitorFunc(fs ...func(mi MonitorItemInterface)) *Monitor

func (*Monitor) OpenMonitor

func (c *Monitor) OpenMonitor() *Monitor

func (*Monitor) SetProportion

func (c *Monitor) SetProportion(CpuProportion float64, MemProportion float64) *Monitor

type MonitorItem

type MonitorItem struct {
	// contains filtered or unexported fields
}

func (*MonitorItem) GetCpu

func (mi *MonitorItem) GetCpu() float64

func (*MonitorItem) GetMem

func (mi *MonitorItem) GetMem() float64

func (*MonitorItem) GetWeight

func (mi *MonitorItem) GetWeight() int

type MonitorItemInterface

type MonitorItemInterface interface {
	GetCpu() float64
	GetMem() float64
	GetWeight() int
}

type OAuthConfig

type OAuthConfig struct {
	OAuthType    OAuthType
	ClientID     string
	ClientSecret string
	RedirectUrl  string
}

func (*OAuthConfig) GetToken

func (o *OAuthConfig) GetToken(code string) (*Token, error)

func (*OAuthConfig) GetTokenAuthUrl

func (o *OAuthConfig) GetTokenAuthUrl(code string) (string, error)

type OAuthInterface

type OAuthInterface interface {
	GetToken(code string) (*Token, error)
}

func NewOAuthConfig

func NewOAuthConfig(OAuthType OAuthType, clientId string, clientSecret string, redirectUrl string) (OAuthInterface, error)

type OAuthType

type OAuthType = struct {
	UrlType string
	// contains filtered or unexported fields
}

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool() *Pool

func (*Pool) Add

func (p *Pool) Add(key string, value interface{})

func (*Pool) Get

func (p *Pool) Get(key string) (val interface{}, ok bool)

type Token

type Token struct {
	OAuthType   *OAuthType
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	Scope       string `json:"scope"`
}

func (*Token) GetUserInfo

func (t *Token) GetUserInfo() (map[string]interface{}, error)

Jump to

Keyboard shortcuts

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