Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMetaServiceClient ¶
Types ¶
type Client ¶
type Client interface {
Close() error
//streamServer
AddStreamServer(ctx context.Context, StreamServerID int64, addr string) error
//stream
GetOrCreateStreamInfoItem(ctx context.Context, name string) (item *store.StreamInfoItem, err error)
CreateStreamInfoItem(ctx context.Context, name string) (item *store.StreamInfoItem, err error)
GetStreamInfoItem(ctx context.Context, name string) (item *store.StreamInfoItem, err error)
GetStreamStat(ctx context.Context, item *store.StreamInfoItem) (begin int64, end int64, err error)
SetStreamReadOffset(ctx context.Context, sessionID int64, offset int64, item *store.StreamInfoItem) error
CreateSessionAndReader(ctx context.Context,
sessionID int64, streamInfo *store.StreamInfoItem) (StreamSession, StreamReader, error)
//session
NewStreamSession(ctx context.Context, sessionID int64, streamInfo *store.StreamInfoItem) (StreamSession, error)
//MQTT
GetOrCreateMQTTSession(ctx context.Context, clientIdentifier string) (*store.MQTTSessionItem, bool, error)
UpdateMQTTClientSession(ctx context.Context, clientIdentifier string, Unsubscribe []string, subscribe map[string]int32) error
DeleteMQTTClientSession(ctx context.Context, clientIdentifier string) (*store.MQTTSessionItem, error)
}
func NewClient ¶
func NewClient(sc proto.MetaServiceClient) Client
type StreamReader ¶
type StreamReader interface {
io.ReadSeeker
io.Closer
Offset() int64
}
type StreamSession ¶
type StreamSession interface {
NewReader() (StreamReader, error)
NewWriter() (StreamWriter, error)
SetReadOffset(offset int64) error
SetReadOffsetWithCb(offset int64, f func(err error))
GetReadOffset() (offset int64, err error)
}
type StreamWriter ¶
Click to show internal directories.
Click to hide internal directories.