remove

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeBlockDeviceEndpoint

func MakeBlockDeviceEndpoint(svc Service) endpoint.Endpoint

func MakeUnblockDeviceEndpoint

func MakeUnblockDeviceEndpoint(svc Service) endpoint.Endpoint

func MarshalDevice

func MarshalDevice(dev *Device) ([]byte, error)

func RegisterHTTPHandlers

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

func RemoveMiddleware

func RemoveMiddleware(store Store) mdm.Middleware

func UnmarshalDevice

func UnmarshalDevice(data []byte, dev *Device) error

Types

type Device

type Device struct {
	UDID string `json:"udid"`
}

type Endpoints

type Endpoints struct {
	BlockDeviceEndpoint   endpoint.Endpoint
	UnblockDeviceEndpoint endpoint.Endpoint
}

func MakeServerEndpoints

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

func (Endpoints) BlockDevice

func (e Endpoints) BlockDevice(ctx context.Context, udid string) error

func (Endpoints) UnblockDevice

func (e Endpoints) UnblockDevice(ctx context.Context, udid string) error

type Middleware

type Middleware func(next Service) Service

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

type RemoveService

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

func New

func New(store Store) (*RemoveService, error)

func (*RemoveService) BlockDevice

func (svc *RemoveService) BlockDevice(ctx context.Context, udid string) error

func (*RemoveService) UnblockDevice

func (svc *RemoveService) UnblockDevice(ctx context.Context, udid string) error

type Service

type Service interface {
	BlockDevice(ctx context.Context, udid string) error
	UnblockDevice(ctx context.Context, udid string) error
}

func NewHTTPClient

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

type Store

type Store interface {
	Save(*Device) error
	DeviceByUDID(string) (*Device, error)
	Delete(string) error
}

Directories

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

Jump to

Keyboard shortcuts

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