Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Token 返回当前客户端使用的 Token Token() string // WithToken 返回使用指定 Token 的客户端 WithToken(token string) Client // Login 登陆获取用户身份返回登陆后的客户端 Login(ctx context.Context, opts LoginOptions) (Client, error) // CreateSelfSubjectReview 检查自身身份 CreateSelfSubjectReview(ctx context.Context, review *authnv1.SelfSubjectReview) (*authnv1.SelfSubjectReview, error) // CreateStream 创建流 CreateStream(ctx context.Context, stream *streamv1.Stream) (*streamv1.Stream, error) // GetStream 获取流 GetStream(ctx context.Context, name string) (*streamv1.Stream, error) // ListStreams 列出流 ListStreams(ctx context.Context) (*streamv1.StreamList, error) // DeleteStream 删除流 DeleteStream(ctx context.Context, name string) error // ConnectStream 连接到流 ConnectStream(ctx context.Context, name string, opts ConnectStreamOptions) (streams.Connection, error) }
Client 客户端
func NewGRPCClient ¶
func NewGRPCClient(opts GRPCClientOptions) (Client, error)
NewGRPCClient 创建基于 gRPC 的客户端
func NewHTTPClient ¶
func NewHTTPClient(opts HTTPClientOptions) (Client, error)
NewHTTPClient 创建基于 HTTP 的客户端
func NewWithPersistentTokenClient ¶
NewWithPersistentTokenClient 创建带持久化 Token 的客户端
type ClientOptions ¶
type ClientOptions struct { // 服务端 URL Server string // 用于认证的 Token Token string // 对传输数据进行压缩 Compress bool }
ClientOptions 客户端选项
type ConnectStreamOptions ¶
type ConnectStreamOptions struct {
ConnectionName string
}
ConnectStreamOptions 连接到流选项
type GRPCClientOptions ¶
type GRPCClientOptions struct { // 服务端地址 ServerAddress string // 用于认证的 Token Token string // 对传输数据进行压缩 Compress bool }
GRPCClientOptions gRPC 客户端选项
type HTTPClientOptions ¶
HTTPClientOptions HTTP 客户端选项
type WithPersistentTokenClient ¶
type WithPersistentTokenClient struct { Client // contains filtered or unexported fields }
WithPersistentTokenClient 带持久化 Token 的客户端
func (*WithPersistentTokenClient) Login ¶
func (c *WithPersistentTokenClient) Login(ctx context.Context, opts LoginOptions) (Client, error)
Login 登陆获取用户身份返回登陆后的客户端
Click to show internal directories.
Click to hide internal directories.