service

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

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

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package service provides the implementation of the Emitto service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateUpdateMask

func ValidateUpdateMask(obj interface{}, mask *mpb.FieldMask) error

ValidateUpdateMask confirms whether the specified update field mask is valid for the respective object. If not, the invalid fields are returned in the error.

Types

type FleetspeakAdminClient

type FleetspeakAdminClient interface {
	// Insert a SensorRequest message for delivery.
	InsertMessage(ctx context.Context, req *spb.SensorRequest, id []byte) error
	// List all clients.
	ListClients(ctx context.Context) ([]*fsspb.Client, error)
	// Close the RPC connection.
	Close() error
}

FleetspeakAdminClient represents a Fleetspeak admin client.

type Service

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

Service contains handlers for Emitto server functions.

func New

func New(store store.Store, filestore filestore.FileStore, fs FleetspeakAdminClient) *Service

New returns a new emitto Service.

func (*Service) AddLocation

func (s *Service) AddLocation(ctx context.Context, req *svpb.AddLocationRequest) (*emptypb.Empty, error)

AddLocation adds the provided Location.

func (*Service) AddRule

func (s *Service) AddRule(ctx context.Context, req *svpb.AddRuleRequest) (*emptypb.Empty, error)

AddRule adds the provided Rule.

func (*Service) DeleteLocation

func (s *Service) DeleteLocation(ctx context.Context, req *svpb.DeleteLocationRequest) (*emptypb.Empty, error)

DeleteLocation deletes an existing Location by Location Name.

func (*Service) DeleteRule

func (s *Service) DeleteRule(ctx context.Context, req *svpb.DeleteRuleRequest) (*emptypb.Empty, error)

DeleteRule deletes an existing Rule by Rule ID.

func (*Service) DeployRules

func (s *Service) DeployRules(req *svpb.DeployRulesRequest, stream svpb.Emitto_DeployRulesServer) error

DeployRules generates a rule file and deploys it to the sensors in the provided location.

func (*Service) ListLocations

ListLocations returns all Locations.

func (*Service) ListRules

ListRules returns Rules for the provided Rule IDs.

func (*Service) ModifyLocation

func (s *Service) ModifyLocation(ctx context.Context, req *svpb.ModifyLocationRequest) (*emptypb.Empty, error)

ModifyLocation updates the specified location.

func (*Service) ModifyRule

func (s *Service) ModifyRule(ctx context.Context, req *svpb.ModifyRuleRequest) (*emptypb.Empty, error)

ModifyRule modifies an existing Rule with the provided field mask.

func (*Service) Process

func (s *Service) Process(ctx context.Context, m *fspb.Message) (*fspb.EmptyMessage, error)

Process receives Fleetspeak messages and stores the enclosed SensorResponse.

Jump to

Keyboard shortcuts

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