node

package
v0.0.0-...-bfb58f9 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capturer

type Capturer interface {
	Start()
	NextOutput() (*video.Capture, error)
	Close()
	Status() string
	UUID() string
	TargetURL() string
}

type CapturerHandler

type CapturerHandler struct {
	L sync.RWMutex
	// contains filtered or unexported fields
}

func NewCapturerHandler

func NewCapturerHandler(
	logger *logrus.Logger,
	metricsService *metrics.Service,
	backboneBuffSize int,
) *CapturerHandler

func (*CapturerHandler) AddCapturer

func (th *CapturerHandler) AddCapturer(t Capturer)

func (*CapturerHandler) AddMJPEGCapturer

func (th *CapturerHandler) AddMJPEGCapturer(uuid, url string, maxFrameBuffer int) error

func (*CapturerHandler) BackboneLen

func (th *CapturerHandler) BackboneLen() int

func (*CapturerHandler) NextResult

func (th *CapturerHandler) NextResult() (*video.Capture, error)

func (*CapturerHandler) RemoveCapturer

func (th *CapturerHandler) RemoveCapturer(uuid string) (Capturer, error)

func (*CapturerHandler) Shutdown

func (th *CapturerHandler) Shutdown()

func (*CapturerHandler) Status

func (th *CapturerHandler) Status() []CapturerStatus

type CapturerStatus

type CapturerStatus struct {
	UUID   string
	URL    string
	Status string
}

type Classifier

type Classifier interface {
	SaveCategories([]string, []byte) error
	FindCategories([]byte) (*FoundCategories, error)
}

type FoundCategories

type FoundCategories struct {
	Matches       []string
	TotalEntities int
}

type GoFace

type GoFace struct {
	// contains filtered or unexported fields
}

func NewGoFace

func NewGoFace(modelsDir string) (*GoFace, error)

func (*GoFace) FindCategories

func (d *GoFace) FindCategories(input []byte) (*FoundCategories, error)

func (*GoFace) SaveCategories

func (d *GoFace) SaveCategories(names []string, bytes []byte) error

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...config.Option) (*Server, error)

func NewFromEnv

func NewFromEnv() (*Server, error)

func NewServer

func NewServer(listenAddr string, service service, metricsAddr string, m *metrics.Service, logger *logrus.Logger) *Server

func (*Server) Shutdown

func (gs *Server) Shutdown()

func (*Server) Start

func (gs *Server) Start() error

type Service

type Service struct {
	L *sync.Mutex
	// contains filtered or unexported fields
}

func NewService

func NewService(
	d Classifier,
	capturerHandler *CapturerHandler,
	metricsService *metrics.Service,
	logger *logrus.Logger,
	timeNow func() time.Time,
) *Service

func (*Service) AddCapturer

func (s *Service) AddCapturer(_ context.Context, request *proto.AddCapturerRequest) (*empty.Empty, error)

func (*Service) InformStatus

func (s *Service) InformStatus(request *proto.InformStatusRequest, stream proto.Node_InformStatusServer) error

func (*Service) LoadCategories

func (s *Service) LoadCategories(_ context.Context, request *proto.LoadCategoriesRequest) (*empty.Empty, error)

func (*Service) ProcessResults

func (s *Service) ProcessResults(_ *empty.Empty, stream proto.Node_ProcessResultsServer) error

func (*Service) RemoveCapturer

func (s *Service) RemoveCapturer(_ context.Context, request *proto.RemoveCapturerRequest) (*empty.Empty, error)

func (*Service) Shutdown

func (s *Service) Shutdown()

func (*Service) Status

func (s *Service) Status() *proto.Status

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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