depsync

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2018 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SyncTopic        = "mdm.DepSync"
	ConfigBucket     = "mdm.DEPConfig"
	AutoAssignBucket = "mdm.DEPAutoAssign"
)

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(db *bolt.DB) (*config, error)

func MakeApplyAutoAssignerEndpoint

func MakeApplyAutoAssignerEndpoint(s Service) endpoint.Endpoint

func MakeGetAutoAssignersEndpoint

func MakeGetAutoAssignersEndpoint(s Service) endpoint.Endpoint

func MakeRemoveAutoAssignerEndpoint

func MakeRemoveAutoAssignerEndpoint(s Service) endpoint.Endpoint

func MakeSyncNowEndpoint

func MakeSyncNowEndpoint(s Service) endpoint.Endpoint

func MarshalEvent

func MarshalEvent(e *Event) ([]byte, error)

MarshalEvent serializes an event to a protocol buffer wire format.

func RegisterHTTPHandlers

func RegisterHTTPHandlers(r *mux.Router, e Endpoints, options ...httptransport.ServerOption)

func UnmarshalEvent

func UnmarshalEvent(data []byte, e *Event) error

UnmarshalEvent parses a protocol buffer representation of data into the Event.

Types

type AutoAssigner

type AutoAssigner struct {
	Filter      string `json:"filter"`
	ProfileUUID string `json:"profile_uuid"`
}

type DEPSyncService

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

func NewService

func NewService(syncer Syncer) *DEPSyncService

func (DEPSyncService) ApplyAutoAssigner

func (s DEPSyncService) ApplyAutoAssigner(ctx context.Context, aa *AutoAssigner) error

func (DEPSyncService) GetAutoAssigners

func (s DEPSyncService) GetAutoAssigners(ctx context.Context) ([]*AutoAssigner, error)

func (DEPSyncService) RemoveAutoAssigner

func (s DEPSyncService) RemoveAutoAssigner(ctx context.Context, filter string) error

func (*DEPSyncService) SyncNow

func (s *DEPSyncService) SyncNow(_ context.Context) error

type Endpoints

type Endpoints struct {
	SyncNowEndpoint            endpoint.Endpoint
	ApplyAutoAssignerEndpoint  endpoint.Endpoint
	GetAutoAssignersEndpoint   endpoint.Endpoint
	RemoveAutoAssignerEndpoint endpoint.Endpoint
}

func MakeServerEndpoints

func MakeServerEndpoints(s Service, outer endpoint.Middleware, others ...endpoint.Middleware) Endpoints

func (Endpoints) ApplyAutoAssigner

func (e Endpoints) ApplyAutoAssigner(ctx context.Context, aa *AutoAssigner) error

func (Endpoints) GetAutoAssigners

func (e Endpoints) GetAutoAssigners(ctx context.Context) ([]*AutoAssigner, error)

func (Endpoints) RemoveAutoAssigner

func (e Endpoints) RemoveAutoAssigner(ctx context.Context, filter string) error

func (Endpoints) SyncNow

func (e Endpoints) SyncNow(ctx context.Context) error

type Event

type Event struct {
	ID      string
	Time    time.Time
	Devices []dep.Device
}

func NewEvent

func NewEvent(devices []dep.Device) *Event

type Option

type Option func(*watcher)

func WithClient

func WithClient(client dep.Client) Option

func WithLogger

func WithLogger(logger log.Logger) Option

type Service

type Service interface {
	SyncNow(context.Context) error
	ApplyAutoAssigner(context.Context, *AutoAssigner) error
	GetAutoAssigners(context.Context) ([]*AutoAssigner, error)
	RemoveAutoAssigner(context.Context, string) error
}

func NewHTTPClient

func NewHTTPClient(instance, token string, logger log.Logger, opts ...httptransport.ClientOption) (Service, error)

type Syncer

type Syncer interface {
	SyncNow()
	GetConfig() *config // TODO: #302
}

func New

func New(pub pubsub.PublishSubscriber, db *bolt.DB, logger log.Logger, opts ...Option) (Syncer, error)

Directories

Path Synopsis
internal
depsyncproto
Package depsyncproto is a generated protocol buffer package.
Package depsyncproto is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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