stream_server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

README

stream-server

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	MetaServerAddr        string        `json:"meta_server_addr"`
	ServerID              int64         `json:"server_id"`
	Host                  string        `json:"grpc_bind_addr"`
	GRPCPort              int           `json:"grpc_port"`
	SStorePath            string        `json:"store_path"`
	LogPath               string        `json:"log_path"`
	AutoAddServer         bool          `json:"auto_add_server"`
	LogLevel              log.Level     `json:"log_level"`
	HeartbeatInterval     time.Duration `json:"heartbeat_interval"`
	DialMetaServerTimeout time.Duration `json:"dial_meta_server_timeout"`
}

func DefaultOptions

func DefaultOptions() Options

func (Options) WithAutoAddServer

func (option Options) WithAutoAddServer(val bool) Options

func (Options) WithDialMetaServerTimeout

func (option Options) WithDialMetaServerTimeout(val time.Duration) Options

func (Options) WithGRPCPort

func (option Options) WithGRPCPort(val int) Options

func (Options) WithHeartbeatInterval

func (option Options) WithHeartbeatInterval(val time.Duration) Options

func (Options) WithHost

func (option Options) WithHost(val string) Options

func (Options) WithLogPath

func (option Options) WithLogPath(val string) Options

func (Options) WithMetaServerAddr

func (option Options) WithMetaServerAddr(val string) Options

func (Options) WithSStorePath

func (option Options) WithSStorePath(val string) Options

func (Options) WithServerID

func (option Options) WithServerID(val int64) Options

type StreamServer

type StreamServer struct {
	Options

	ServerInfoBase *MSStore.ServerInfoBase
	// contains filtered or unexported fields
}

func New

func New(options Options) *StreamServer

func (*StreamServer) GetStreamStat

func (server *StreamServer) GetStreamStat(ctx context.Context, request *proto.GetStreamStatRequest) (*proto.GetStreamStatResponse, error)

func (*StreamServer) ReadStream

func (server *StreamServer) ReadStream(request *proto.ReadStreamRequest, stream proto.StreamService_ReadStreamServer) error

func (*StreamServer) Start

func (server *StreamServer) Start() error

func (*StreamServer) Stop

func (server *StreamServer) Stop(ctx context.Context) error

func (*StreamServer) WriteStream

func (server *StreamServer) WriteStream(stream proto.StreamService_WriteStreamServer) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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