grpcstdio

package
v0.0.100 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoCompression   compressionKind = "compression.none"
	ZstdCompression compressionKind = "compression.zstd"
)

Variables

View Source
var (
	DialArgs_StreamType_name = map[int32]string{
		0: "STREAM_TYPE_UNKNOWN",
		1: "STREAM_TYPE_GRPC",
	}
	DialArgs_StreamType_value = map[string]int32{
		"STREAM_TYPE_UNKNOWN": 0,
		"STREAM_TYPE_GRPC":    1,
	}
)

Enum value maps for DialArgs_StreamType.

View Source
var ErrListenerClosed = errors.New("listener was closed")
View Source
var File_internal_grpcstdio_types_proto protoreflect.FileDescriptor

Functions

func NewConnection

func NewConnection(in io.Writer, out io.Reader) net.Conn

Types

type DialArgs

type DialArgs struct {
	StreamType  DialArgs_StreamType `` /* 147-byte string literal not displayed */
	ServiceName string              `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	// contains filtered or unexported fields
}

func (*DialArgs) Descriptor deprecated

func (*DialArgs) Descriptor() ([]byte, []int)

Deprecated: Use DialArgs.ProtoReflect.Descriptor instead.

func (*DialArgs) GetServiceName

func (x *DialArgs) GetServiceName() string

func (*DialArgs) GetStreamType

func (x *DialArgs) GetStreamType() DialArgs_StreamType

func (*DialArgs) ProtoMessage

func (*DialArgs) ProtoMessage()

func (*DialArgs) ProtoReflect

func (x *DialArgs) ProtoReflect() protoreflect.Message

func (*DialArgs) Reset

func (x *DialArgs) Reset()

func (*DialArgs) String

func (x *DialArgs) String() string

type DialArgs_StreamType

type DialArgs_StreamType int32
const (
	DialArgs_STREAM_TYPE_UNKNOWN DialArgs_StreamType = 0 // Defaults to gRPC.
	DialArgs_STREAM_TYPE_GRPC    DialArgs_StreamType = 1
)

func (DialArgs_StreamType) Descriptor

func (DialArgs_StreamType) Enum

func (DialArgs_StreamType) EnumDescriptor deprecated

func (DialArgs_StreamType) EnumDescriptor() ([]byte, []int)

Deprecated: Use DialArgs_StreamType.Descriptor instead.

func (DialArgs_StreamType) Number

func (DialArgs_StreamType) String

func (x DialArgs_StreamType) String() string

func (DialArgs_StreamType) Type

type DialedStream

type DialedStream struct {
	*Stream
	Args *DialArgs
}

type HelloArgs

type HelloArgs struct {
	FnApiVersion   int32 `protobuf:"varint,1,opt,name=fn_api_version,json=fnApiVersion,proto3" json:"fn_api_version,omitempty"`
	ToolApiVersion int32 `protobuf:"varint,2,opt,name=tool_api_version,json=toolApiVersion,proto3" json:"tool_api_version,omitempty"`
	// contains filtered or unexported fields
}

func (*HelloArgs) Descriptor deprecated

func (*HelloArgs) Descriptor() ([]byte, []int)

Deprecated: Use HelloArgs.ProtoReflect.Descriptor instead.

func (*HelloArgs) GetFnApiVersion

func (x *HelloArgs) GetFnApiVersion() int32

func (*HelloArgs) GetToolApiVersion

func (x *HelloArgs) GetToolApiVersion() int32

func (*HelloArgs) ProtoMessage

func (*HelloArgs) ProtoMessage()

func (*HelloArgs) ProtoReflect

func (x *HelloArgs) ProtoReflect() protoreflect.Message

func (*HelloArgs) Reset

func (x *HelloArgs) Reset()

func (*HelloArgs) String

func (x *HelloArgs) String() string

type NewSessionOpt

type NewSessionOpt func(*Session)

func WithCloseNotifier

func WithCloseNotifier(f func(*Stream)) NewSessionOpt

func WithCompression

func WithCompression(kind compressionKind) NewSessionOpt

func WithDebug

func WithDebug(f func(string, ...interface{})) NewSessionOpt

func WithDefaults

func WithDefaults() NewSessionOpt

func WithVersion

func WithVersion(version int) NewSessionOpt

type Session

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

func NewSession

func NewSession(ctx context.Context, r io.Reader, w io.Writer, opts ...NewSessionOpt) (*Session, error)

func (*Session) Accept

func (s *Session) Accept() (*DialedStream, error)

func (*Session) Dial

func (s *Session) Dial(dial *DialArgs) (*Stream, error)

func (*Session) Listener

func (s *Session) Listener() net.Listener

func (*Session) Shutdown

func (s *Session) Shutdown()

type StdinListener

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

func NewListener

func NewListener(ctx context.Context) *StdinListener

func (*StdinListener) Accept

func (lis *StdinListener) Accept() (net.Conn, error)

func (*StdinListener) Addr

func (lis *StdinListener) Addr() net.Addr

func (*StdinListener) Close

func (lis *StdinListener) Close() error

func (*StdinListener) Ready

func (lis *StdinListener) Ready(ctx context.Context, conn net.Conn) error

type Stream

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

func (*Stream) Close

func (s *Stream) Close() error

func (*Stream) LocalAddr

func (s *Stream) LocalAddr() net.Addr

func (*Stream) Read

func (s *Stream) Read(p []byte) (int, error)

func (*Stream) RemoteAddr

func (s *Stream) RemoteAddr() net.Addr

func (*Stream) SetDeadline

func (s *Stream) SetDeadline(t time.Time) error

func (*Stream) SetReadDeadline

func (s *Stream) SetReadDeadline(t time.Time) error

func (*Stream) SetWriteDeadline

func (s *Stream) SetWriteDeadline(t time.Time) error

func (*Stream) Write

func (s *Stream) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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