transport

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ClientMaxReceiveMessageSize - Max gRPC message size ~2Gb.
	ClientMaxReceiveMessageSize = (2 * gb) - 1 // 2Gb - 1 byte

)

Variables

View Source
var ErrNoTLSCredentials = errors.New("the Teamclient has no TLS credentials to use")

ErrNoTLSCredentials is an error raised if the teamclient was asked to setup, or try connecting with, TLS credentials. If such an error is raised, make sure your team client has correctly fetched -using client.Config()- a remote teamserver config.

Functions

func LogMiddlewareOptions

func LogMiddlewareOptions(cli *client.Client) []grpc.DialOption

LogMiddlewareOptions is an example list of gRPC options with logging middleware set up. This function uses the core teamclient loggers to log the gRPC stack/requests events. The Teamclient of this package uses them by default.

func TLSAuthMiddleware

func TLSAuthMiddleware(cli *client.Client) ([]grpc.DialOption, error)

Types

type TeamClient

type TeamClient struct {
	Conn *grpc.ClientConn
	// contains filtered or unexported fields
}

TeamClient is a type implementing the reeflective/team/client.Dialer interface, and can thus be used to communicate with any remote or in-memory Sliver teamserver. When used to connect remotely, this type can safely be instantiated with `new(transport.Teamclient)`.

func NewClient

func NewClient(opts ...grpc.DialOption) *TeamClient

NewClient creates a teamclient transport with specific gRPC options. It can also be used for in-memory clients, which specify their dialer.

func (*TeamClient) Close

func (h *TeamClient) Close() error

Close implements team/client.Dialer.Close(). It closes the gRPC client connection if any.

func (*TeamClient) Dial

func (h *TeamClient) Dial() (err error)

Dial implements team/client.Dialer.Dial(). It uses the teamclient remote server configuration as a target of a dial call. If the connection is successful, the teamclient registers a Sliver RPC client.

func (*TeamClient) Init

func (h *TeamClient) Init(cli *client.Client) error

Init implements team/client.Dialer.Init(c). It uses teamclient core driver for a remote server configuration. It also includes all pre-existing Sliver-specific log/middleware.

type TokenAuth

type TokenAuth string

TokenAuth extracts authentication metadata from contexts, specifically the "Authorization": "Bearer" key:value pair.

func (TokenAuth) GetRequestMetadata

func (t TokenAuth) GetRequestMetadata(_ context.Context, _ ...string) (map[string]string, error)

Return value is mapped to request headers.

func (TokenAuth) RequireTransportSecurity

func (TokenAuth) RequireTransportSecurity() bool

RequireTransportSecurity always return true.

Jump to

Keyboard shortcuts

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