cloud

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const NormExpiredDuration = time.Second * 7200

Variables

This section is empty.

Functions

This section is empty.

Types

type CredentialData

type CredentialData struct {
	Credentials struct {
		SessionToken string `json:"sessionToken"`
		TmpSecretId  string `json:"tmpSecretId"`
		TmpSecretKey string `json:"tmpSecretKey"`
	} `json:"credentials"`
	ExpiredTime int `json:"expiredTime"`
}

func GetTkeCredential

func GetTkeCredential() (*CredentialData, error)

type NormCredential

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

func GetNormCredentialInstance

func GetNormCredentialInstance() *NormCredential

func NewNormCredential

func NewNormCredential(expiredDuration time.Duration, refresher Refresher) (NormCredential, error)

func (*NormCredential) GetCredential

func (normCred *NormCredential) GetCredential() (string, string, string, bool, error)

func (*NormCredential) GetSecretId

func (normCred *NormCredential) GetSecretId() (string, error)

func (*NormCredential) GetSecretKey

func (normCred *NormCredential) GetSecretKey() (string, error)

type NormRefresher

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

func NewNormRefresher

func NewNormRefresher(expiredDuration time.Duration) (NormRefresher, error)

func (NormRefresher) Refresh

func (nr NormRefresher) Refresh() (secretId string, secretKey string, token string, expiredAt int, err error)

type NormResponse

type NormResponse struct {
	Code     int            `json:"returnValue"`
	Msg      string         `json:"returnMsg"`
	Version  string         `json:"version"`
	Password string         `json:"password"`
	Data     CredentialData `json:"returnData"`
}

type Refresher

type Refresher interface {
	Refresh() (string, string, string, int, error)
}

Jump to

Keyboard shortcuts

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