svc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceContext

type ServiceContext struct {
	Config   config.Config
	LogicRPC logicclient.Logic
	// contains filtered or unexported fields
}

func NewServiceContext

func NewServiceContext(c config.Config) *ServiceContext

func (*ServiceContext) Bucket

func (s *ServiceContext) Bucket(subKey string) *comet.Bucket

Bucket get the bucket by subkey.

func (*ServiceContext) Buckets

func (s *ServiceContext) Buckets() []*comet.Bucket

Buckets return all buckets.

func (*ServiceContext) Connect

func (s *ServiceContext) Connect(c context.Context, p *protocol.Proto) (key string, hb time.Duration, errMsg string, err error)

Connect connected a connection.

func (*ServiceContext) Disconnect

func (s *ServiceContext) Disconnect(ctx context.Context, key string) error

Disconnect disconnected a connection.

func (*ServiceContext) Heartbeat

func (s *ServiceContext) Heartbeat(ctx context.Context, key string) error

Heartbeat a connection session.

func (*ServiceContext) Operate

func (s *ServiceContext) Operate(ctx context.Context, p *protocol.Proto, ch *comet.Channel, tsk *dtask.Task) error

Operate operate.

func (*ServiceContext) RandServerHearbeat

func (s *ServiceContext) RandServerHearbeat() time.Duration

RandServerHearbeat rand server heartbeat.

func (*ServiceContext) Receive

func (s *ServiceContext) Receive(ctx context.Context, key string, p *protocol.Proto) error

Receive receive a message.

func (*ServiceContext) Round

func (s *ServiceContext) Round() *comet.Round

Round return all round.

Jump to

Keyboard shortcuts

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