subject

package
v0.0.0-...-6c7272e Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package subject holds the code for handling tracable applications in the robot system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, grpcServer *grpc.Server, subjects Subjects) error

Serve wraps a subject service in a grpc server.

Types

type Handler

type Handler func(context.Context, *Subject) error

Handler is a function that handles a stream of Subjects.

type Subjects

type Subjects interface {
	// Search returns a iterator of matching subjects from the store.
	Search(context.Context, *search.Query, Handler) error
	// Add adds a new subject to the set.
	Add(ctx context.Context, id string, obbID string, hints *Hints) (*Subject, bool, error)
	// Update changes the values of a subject.
	Update(ctx context.Context, subj *Subject) (*Subject, error)
}

Subjects is the interface to a subject manager.

func NewLocal

func NewLocal(ctx context.Context, library record.Library, store *stash.Client) (Subjects, error)

NewLocal returns a new persistent store of Subjects.

func NewRemote

func NewRemote(ctx context.Context, conn *grpc.ClientConn) Subjects

NewRemote returns a Subjects that talks to a remote grpc Subject service.

Jump to

Keyboard shortcuts

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