Documentation ¶
Index ¶
- type Session
- func (s *Session) At(rev ident.Revision) (rinq.Revision, error)
- func (s *Session) Attrs() (ident.Ref, attributes.Catalog)
- func (s *Session) AttrsIn(ns string) (ident.Ref, attributes.VTable)
- func (s *Session) Call(ctx context.Context, ns, cmd string, out *rinq.Payload) (*rinq.Payload, error)
- func (s *Session) CallAsync(ctx context.Context, ns, cmd string, out *rinq.Payload) (ident.MessageID, error)
- func (s *Session) CurrentRevision() rinq.Revision
- func (s *Session) Destroy()
- func (s *Session) Done() <-chan struct{}
- func (s *Session) Execute(ctx context.Context, ns, cmd string, p *rinq.Payload) error
- func (s *Session) ID() ident.SessionID
- func (s *Session) Listen(ns string, h rinq.NotificationHandler) error
- func (s *Session) Notify(ctx context.Context, ns, t string, target ident.SessionID, p *rinq.Payload) error
- func (s *Session) NotifyMany(ctx context.Context, ns, t string, con constraint.Constraint, p *rinq.Payload) error
- func (s *Session) SetAsyncHandler(h rinq.AsyncHandler) error
- func (s *Session) TryClear(rev ident.Revision, ns string) (rinq.Revision, *attributes.Diff, error)
- func (s *Session) TryDestroy(rev ident.Revision) (bool, error)
- func (s *Session) TryUpdate(rev ident.Revision, ns string, attrs attributes.List) (rinq.Revision, *attributes.Diff, error)
- func (s *Session) Unlisten(ns string) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is the implementation of rinq.Session.
The implementation is split into two files. This file contains methods that are declared in rinq.Session, whereas the session_state.go file contains a lower-level API for manipulating the session state which is used throughout the Rinq internals.
func NewSession ¶
func NewSession( id ident.SessionID, invoker command.Invoker, notifier notify.Notifier, listener notify.Listener, logger twelf.Logger, tracer opentracing.Tracer, ) *Session
NewSession returns a new local session.
func (*Session) At ¶
At returns a revision representing the state at a specific revision number. The revision can not be newer than the current session-ref.
func (*Session) Attrs ¶
func (s *Session) Attrs() (ident.Ref, attributes.Catalog)
Attrs returns all attributes at the most recent revision.
func (*Session) AttrsIn ¶
AttrsIn returns all attributes in the ns namespace at the most recent revision.
func (*Session) Call ¶
func (s *Session) Call(ctx context.Context, ns, cmd string, out *rinq.Payload) (*rinq.Payload, error)
Call implements rinq.Session.Call()
func (*Session) CallAsync ¶
func (s *Session) CallAsync(ctx context.Context, ns, cmd string, out *rinq.Payload) (ident.MessageID, error)
CallAsync implements rinq.Session.CallAsync()
func (*Session) CurrentRevision ¶
CurrentRevision implements rinq.Session.CurrentRevision()
func (*Session) Listen ¶
func (s *Session) Listen(ns string, h rinq.NotificationHandler) error
Listen implements rinq.Session.Listen()
func (*Session) Notify ¶
func (s *Session) Notify(ctx context.Context, ns, t string, target ident.SessionID, p *rinq.Payload) error
Notify implements rinq.Session.Notify()
func (*Session) NotifyMany ¶
func (s *Session) NotifyMany(ctx context.Context, ns, t string, con constraint.Constraint, p *rinq.Payload) error
NotifyMany implements rinq.Session.NotifyMany()
func (*Session) SetAsyncHandler ¶
func (s *Session) SetAsyncHandler(h rinq.AsyncHandler) error
SetAsyncHandler implements rinq.Session.SetAsyncHandler()
func (*Session) TryClear ¶
TryClear updates all attributes in the ns namespace of the attribute table to the empty string and returns the new head revision.
The operation fails if ref is not the current session-ref, there are any frozen attributes, or the session has been destroyed.
func (*Session) TryDestroy ¶
TryDestroy destroys the session, preventing further updates.
The operation fails if ref is not the current session-ref. It is not an error to destroy an already-destroyed session.
first is true if this call caused the session to be destroyed.
func (*Session) TryUpdate ¶
func (s *Session) TryUpdate(rev ident.Revision, ns string, attrs attributes.List) (rinq.Revision, *attributes.Diff, error)
TryUpdate adds or updates attributes in the ns namespace of the attribute table and returns the new head revision.
The operation fails if ref is not the current session-ref, attrs includes changes to frozen attributes, or the session has been destroyed.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a collection of local sessions which provides an implementation of revisions.Store.
func (*Store) GetRevision ¶
GetRevision returns the session revision for the given ref.