metadata

package
v2.10.7 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultAddr = "localhost:6770"
	DefaultPath = "/latest/meta-data/iam/security-credentials/default"
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Addr string
	Path string

	Trace ClientTrace
	Dial  func(ctx context.Context, network, addr string) (net.Conn, error)
	// contains filtered or unexported fields
}

func (*Client) Token

func (c *Client) Token(ctx context.Context) (token string, err error)

type ClientTrace

type ClientTrace struct {
	OnDial         func(DialStartInfo) func(DialDoneInfo)
	OnWriteRequest func(WriteRequestStartInfo) func(WriteRequestDoneInfo)
	OnReadResponse func(ReadResponseStartInfo) func(ReadResponseDoneInfo)
}

func (ClientTrace) Compose

func (t ClientTrace) Compose(x ClientTrace) (ret ClientTrace)

Compose returns a new ClientTrace which has functional fields composed both from t and x.

type DialDoneInfo

type DialDoneInfo struct {
	Network string
	Addr    string
	Conn    net.Conn
	Error   error
}

type DialStartInfo

type DialStartInfo struct {
	Network string
	Addr    string
}

type ReadResponseDoneInfo

type ReadResponseDoneInfo struct {
	Conn    net.Conn
	Code    string
	Expires time.Time
	Error   error
}

type ReadResponseStartInfo

type ReadResponseStartInfo struct {
	Conn net.Conn
}

type WriteRequestDoneInfo

type WriteRequestDoneInfo struct {
	Conn  net.Conn
	Error error
}

type WriteRequestStartInfo

type WriteRequestStartInfo struct {
	Conn net.Conn
}

Jump to

Keyboard shortcuts

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