iap

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package iap provides a client for the IAP tunneling protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCompression

func WithCompression() func(*dialOptions)

WithCompression is a functional option that enables compression.

func WithHost

func WithHost(host, region, network, destGroup string) func(*dialOptions)

WithHost is a functional option that sets the host, region, network, and destination group.

func WithInstance

func WithInstance(instance, zone, ninterface string) func(*dialOptions)

WithInstance is a functional option that sets the instance, zone, and network interface.

func WithPort

func WithPort(port string) func(*dialOptions)

WithPort is a functional option that sets the destination port.

func WithProject

func WithProject(project string) func(*dialOptions)

WithProject is a functional option that sets the project ID.

func WithTokenSource added in v0.1.3

func WithTokenSource(tokenSource *oauth2.TokenSource) func(*dialOptions)

WithTokenSource is a functional option that sets the authorization toke source.

Types

type CloseError added in v0.1.4

type CloseError struct {
	Code   int
	Reason string
}

func (*CloseError) Error added in v0.1.4

func (e *CloseError) Error() string

type Conn

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

func Dial

func Dial(ctx context.Context, opts ...DialOption) (*Conn, error)

Dial connects to the IAP proxy and returns a Conn or error if the connection fails.

func (*Conn) Close

func (c *Conn) Close() error

Close closes the connection.

func (*Conn) LocalAddr added in v0.1.4

func (c *Conn) LocalAddr() net.Addr

LocalAddr returns the local network address.

func (*Conn) Read

func (c *Conn) Read(buf []byte) (n int, err error)

Read reads data from the connection.

func (*Conn) Received added in v0.1.2

func (c *Conn) Received() uint64

Received returns the number of bytes received and acked.

func (*Conn) RemoteAddr added in v0.1.4

func (c *Conn) RemoteAddr() net.Addr

RemoteAddr returns the remote network address.

func (*Conn) Sent added in v0.1.2

func (c *Conn) Sent() uint64

Sent returns the number of bytes sent and acked.

func (*Conn) SessionID

func (c *Conn) SessionID() string

SessionID returns the session ID of the connection.

func (*Conn) SetDeadline added in v0.1.4

func (c *Conn) SetDeadline(t time.Time) error

SetDeadline sets the read and write deadlines associated with the connection.

func (*Conn) SetReadDeadline added in v0.1.4

func (c *Conn) SetReadDeadline(t time.Time) error

SetReadDeadline sets the deadline for future Read calls.

func (*Conn) SetWriteDeadline added in v0.1.4

func (c *Conn) SetWriteDeadline(t time.Time) error

SetWriteDeadline sets the deadline for future Write calls.

func (*Conn) Write

func (c *Conn) Write(buf []byte) (n int, err error)

Write writes data to the connection.

type DialOption

type DialOption func(*dialOptions)

type ProtocolError added in v0.1.3

type ProtocolError struct {
	Err string
}

func (*ProtocolError) Error added in v0.1.3

func (e *ProtocolError) Error() string

Jump to

Keyboard shortcuts

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