session

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const SessionNotInitialized jrpc2.Code = -32002

Variables

This section is empty.

Functions

func NewSession

func NewSession(exitFunc context.CancelFunc) *session

func SessionAlreadyDownErr

func SessionAlreadyDownErr(reqID string) error

func SessionAlreadyInitializedErr

func SessionAlreadyInitializedErr(reqID string) error

func SessionNotInitializedErr

func SessionNotInitializedErr(state sessionState) error

Types

type ClientCaller added in v0.25.0

type ClientCaller interface {
	Callback(ctx context.Context, method string, params interface{}) (*jrpc2.Response, error)
}

type ClientNotifier added in v0.24.0

type ClientNotifier interface {
	Notify(ctx context.Context, method string, params interface{}) error
}

type InvalidURIErr

type InvalidURIErr struct {
	URI string
}

func (*InvalidURIErr) Error

func (e *InvalidURIErr) Error() string

type Server added in v0.25.0

type Server interface {
	ClientNotifier
	ClientCaller
}

type Session

type Session interface {
	Assigner() (jrpc2.Assigner, error)
	Finish(jrpc2.Assigner, jrpc2.ServerStatus)
	SetLogger(*log.Logger)
}

type SessionFactory

type SessionFactory func(context.Context) Session

Jump to

Keyboard shortcuts

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