gs

package
v0.0.0-...-6d0effa Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCanceled = status.New(codes.Canceled, "canceled").Err()

Functions

This section is empty.

Types

type Null

type Null struct{}

Null is a placeholder type for gs.Stream[*gs.Null]

type NullStream

type NullStream Stream[*Null]

NullStream is a placeholder type for gs.Stream[*gs.Null] It is useful for generating a stream that does not send or receive any message. but only to trigger the stream function. when the Recv function is triggered, arguments of struct will be updated. It is used in the following way: @stream(bidi) or @stream(c2s) @ stream(s2c)

type Stream

type Stream[T any] interface {
	Context() context.Context
	Send(m T) error
	Recv() (T, error)
}

Stream is a generic interface for stream It is used in the following way: @stream(bidi) or @stream(c2s) @ stream(s2c) It is used for sending or receiving T message. when the Recv function is triggered,besides receiving message, arguments of struct will also be updated.

Jump to

Keyboard shortcuts

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