core

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Overview

Code generated for package core by go-bindata DO NOT EDIT. (@generated) sources: data/html/mountingPage.html

Index

Constants

This section is empty.

Variables

View Source
var (
	GitCommit     string //nolint:gochecknoglobals
	StsVersion    string //nolint:gochecknoglobals
	BuiltTime     string //nolint:gochecknoglobals
	OsArch        string //nolint:gochecknoglobals
	RcloneVersion string //nolint:gochecknoglobals
)

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func CacheDir

func CacheDir() (string, error)

func CreateHash

func CreateHash(key string) string

func Decrypt

func Decrypt(data []byte, password *memguard.Enclave) []byte

func Encrypt

func Encrypt(data []byte, password *memguard.Enclave) []byte

func ExePath

func ExePath() (string, error)

func Execute

func Execute()

Execute of the sts-wire command.

func MountVolume

func MountVolume(instance string, remotePath string, localPath string, configPath string) (*exec.Cmd, chan error, string, error)

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func PrepareRclone

func PrepareRclone() error

func RandomState

func RandomState() string

Returns a base64 encoded random 32 byte string.

func RcloneLogErrors added in v1.0.5

func RcloneLogErrors(logPath string) chan string

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type AssumeRoleWithWebIdentityResponse

type AssumeRoleWithWebIdentityResponse struct {
	XMLName          xml.Name          `xml:"https://sts.amazonaws.com/doc/2011-06-15/ AssumeRoleWithWebIdentityResponse" json:"-"`
	Result           WebIdentityResult `xml:"AssumeRoleWithWebIdentityResult"`
	ResponseMetadata struct {
		RequestID string `xml:"RequestId,omitempty"`
	} `xml:"ResponseMetadata,omitempty"`
}

AssumeRoleWithWebIdentityResponse the struct of the STS WebIdentity call response.

type AssumedRoleUser

type AssumedRoleUser struct {
	Arn           string
	AssumedRoleID string `xml:"AssumeRoleId"`
}

AssumedRoleUser - The identifiers for the temporary security credentials that the operation returns. Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumedRoleUser

type ClientResponse

type ClientResponse struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	Endpoint     string `json:"registration_client_uri"`
}

type GetInputWrapper

type GetInputWrapper struct {
	Scanner bufio.Reader
}

func (*GetInputWrapper) GetInputString

func (t *GetInputWrapper) GetInputString(question string, def string) (text string, err error)

func (*GetInputWrapper) GetPassword

func (t *GetInputWrapper) GetPassword(question string, only4Decription bool) (password *memguard.Enclave, err error)

type IAMClientConfig

type IAMClientConfig struct {
	CallbackURL string
	Host        string
	Port        int
	ClientName  string
}

type IAMCreds

type IAMCreds struct {
	AccessToken  string
	RefreshToken string
}

IAMCreds ..

type IAMProvider

type IAMProvider struct {
	StsEndpoint       string
	HTTPClient        *http.Client
	Token             string
	Creds             *AssumeRoleWithWebIdentityResponse
	RefreshTokenRenew int
}

IAMProvider credential provider for oidc

func (*IAMProvider) IsExpired

func (t *IAMProvider) IsExpired() bool

IsExpired test.

func (*IAMProvider) Retrieve

func (t *IAMProvider) Retrieve() (credentials.Value, error)

Retrieve credentials.

type InitClientConfig

type InitClientConfig struct {
	ConfDir        string
	ClientConfig   IAMClientConfig
	Scanner        GetInputWrapper
	HTTPClient     http.Client
	IAMServer      string
	ClientTemplate string
	NoPWD          bool
}

func (*InitClientConfig) InitClient

func (t *InitClientConfig) InitClient(instance string) (endpoint string, clientResponse ClientResponse, passwd *memguard.Enclave, err error)

type RCloneStruct

type RCloneStruct struct {
	Address  string
	Instance string
}

RCloneStruct ..

type RefreshTokenStruct

type RefreshTokenStruct struct {
	RefreshToken string `json:"refresh_token"`
	AccessToken  string `json:"access_token"`
}

type Server

type Server struct {
	Client            InitClientConfig
	Instance          string
	S3Endpoint        string
	RemotePath        string
	LocalPath         string
	Endpoint          string
	Response          ClientResponse
	RefreshTokenRenew int
	// contains filtered or unexported fields
}

Server ..

func (*Server) Start

func (s *Server) Start() (ClientResponse, IAMCreds, string, error)

Start ..

func (*Server) UpdateTokenLoop

func (s *Server) UpdateTokenLoop(clientResponse ClientResponse, credsIAM IAMCreds, endpoint string)

type WebIdentityResult

type WebIdentityResult struct {
	AssumedRoleUser             AssumedRoleUser  `xml:",omitempty"`
	Audience                    string           `xml:",omitempty"`
	Credentials                 auth.Credentials `xml:",omitempty"`
	PackedPolicySize            int              `xml:",omitempty"`
	Provider                    string           `xml:",omitempty"`
	SubjectFromWebIdentityToken string           `xml:",omitempty"`
}

WebIdentityResult - Contains the response to a successful AssumeRoleWithWebIdentity request, including temporary credentials that can be used to make MinIO API requests.

Jump to

Keyboard shortcuts

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