dep

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeAssignProfileEndpoint

func MakeAssignProfileEndpoint(svc Service) endpoint.Endpoint

func MakeDefineProfileEndpoint

func MakeDefineProfileEndpoint(svc Service) endpoint.Endpoint

func MakeFetchProfileEndpoint

func MakeFetchProfileEndpoint(svc Service) endpoint.Endpoint

func MakeGetAccountInfoEndpoint

func MakeGetAccountInfoEndpoint(svc Service) endpoint.Endpoint

func MakeGetDeviceDetailsEndpoint

func MakeGetDeviceDetailsEndpoint(svc Service) endpoint.Endpoint

func MakeRemoveProfileEndpoint

func MakeRemoveProfileEndpoint(svc Service) endpoint.Endpoint

func RegisterHTTPHandlers

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

Types

type DEPClient

type DEPClient interface {
	DefineProfile(*dep.Profile) (*dep.ProfileResponse, error)
	AssignProfile(string, ...string) (*dep.ProfileResponse, error)
	RemoveProfile(...string) (map[string]string, error)
	FetchProfile(string) (*dep.Profile, error)
	Account() (*dep.Account, error)
	DeviceDetails(...string) (*dep.DeviceDetailsResponse, error)
}

type DEPService

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

func New

func New(client DEPClient, subscriber pubsub.Subscriber) *DEPService

func (*DEPService) AssignProfile

func (svc *DEPService) AssignProfile(ctx context.Context, id string, serials ...string) (*dep.ProfileResponse, error)

func (*DEPService) DefineProfile

func (svc *DEPService) DefineProfile(ctx context.Context, p *dep.Profile) (*dep.ProfileResponse, error)

func (*DEPService) FetchProfile

func (svc *DEPService) FetchProfile(ctx context.Context, uuid string) (*dep.Profile, error)

func (*DEPService) GetAccountInfo

func (svc *DEPService) GetAccountInfo(ctx context.Context) (*dep.Account, error)

func (*DEPService) GetDeviceDetails

func (svc *DEPService) GetDeviceDetails(ctx context.Context, serials []string) (*dep.DeviceDetailsResponse, error)

func (*DEPService) RemoveProfile

func (svc *DEPService) RemoveProfile(ctx context.Context, serials ...string) (map[string]string, error)

func (*DEPService) Run

func (svc *DEPService) Run() error

type Endpoints

type Endpoints struct {
	DefineProfileEndpoint    endpoint.Endpoint
	FetchProfileEndpoint     endpoint.Endpoint
	GetAccountInfoEndpoint   endpoint.Endpoint
	GetDeviceDetailsEndpoint endpoint.Endpoint
	AssignProfileEndpoint    endpoint.Endpoint
	RemoveProfileEndpoint    endpoint.Endpoint
}

func MakeServerEndpoints

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

func (Endpoints) AssignProfile

func (e Endpoints) AssignProfile(ctx context.Context, id string, serials ...string) (*dep.ProfileResponse, error)

func (Endpoints) DefineProfile

func (e Endpoints) DefineProfile(ctx context.Context, p *dep.Profile) (*dep.ProfileResponse, error)

func (Endpoints) FetchProfile

func (e Endpoints) FetchProfile(ctx context.Context, uuid string) (*dep.Profile, error)

func (Endpoints) GetAccountInfo

func (e Endpoints) GetAccountInfo(ctx context.Context) (*dep.Account, error)

func (Endpoints) GetDeviceDetails

func (e Endpoints) GetDeviceDetails(ctx context.Context, serials []string) (*dep.DeviceDetailsResponse, error)

func (Endpoints) RemoveProfile

func (e Endpoints) RemoveProfile(ctx context.Context, serials ...string) (map[string]string, error)

type Service

type Service interface {
	DefineProfile(ctx context.Context, p *dep.Profile) (*dep.ProfileResponse, error)
	AssignProfile(ctx context.Context, uuid string, serials ...string) (*dep.ProfileResponse, error)
	RemoveProfile(ctx context.Context, serials ...string) (map[string]string, error)
	GetAccountInfo(ctx context.Context) (*dep.Account, error)
	GetDeviceDetails(ctx context.Context, serials []string) (*dep.DeviceDetailsResponse, error)
	FetchProfile(ctx context.Context, uuid string) (*dep.Profile, error)
}

func NewHTTPClient

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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