connect

package
v0.0.0-...-29c6822 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2018 License: MIT, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ConnectTopic = "mdm.Connect"

Variables

This section is empty.

Functions

func EncodeError

func EncodeError(ctx context.Context, err error, w http.ResponseWriter)

EncodeError is used by the HTTP transport to encode service errors in HTTP. The EncodeError should be passed to the Go-Kit httptransport as the ServerErrorEncoder to encode error responses.

func MakeConnectEndpoint

func MakeConnectEndpoint(svc Service) endpoint.Endpoint

func MarshalEvent

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

func UnmarshalEvent

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

Types

type ConnectService

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

func New

func New(queue Queue, pub pubsub.Publisher) (*ConnectService, error)

func (*ConnectService) Acknowledge

func (svc *ConnectService) Acknowledge(ctx context.Context, req MDMConnectRequest) (payload []byte, err error)

type Endpoints

type Endpoints struct {
	ConnectEndpoint endpoint.Endpoint
}

type Event

type Event struct {
	ID       string
	Time     time.Time
	Response mdm.Response
	Raw      []byte
}

func NewEvent

func NewEvent(resp MDMConnectRequest) *Event

type HTTPHandlers

type HTTPHandlers struct {
	ConnectHandler http.Handler
}

func MakeHTTPHandlers

func MakeHTTPHandlers(ctx context.Context, endpoints Endpoints, opts ...httptransport.ServerOption) HTTPHandlers

type MDMConnectRequest

type MDMConnectRequest struct {
	Raw         []byte
	MDMResponse mdm.Response
}

type Middleware

type Middleware func(Service) Service

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

type Queue

type Queue interface {
	Next(context.Context, mdm.Response) (*queue.Command, error)
}

type Service

type Service interface {

	// Acknowledge acknowledges a response sent by a device and returns
	// the next payload if one is available.
	Acknowledge(ctx context.Context, req MDMConnectRequest) (payload []byte, err error)
}

The Service accepts responses sent to an MDM server by an enrolled device.

Directories

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

Jump to

Keyboard shortcuts

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