list

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2017 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeDEPAccountInfoResponse

func DecodeDEPAccountInfoResponse(_ context.Context, r *http.Response) (interface{}, error)

func DecodeDEPDeviceDetailsReponse

func DecodeDEPDeviceDetailsReponse(_ context.Context, r *http.Response) (interface{}, error)

func DecodeDEPProfileResponse

func DecodeDEPProfileResponse(_ context.Context, r *http.Response) (interface{}, error)

func DecodeDevicesResponse

func DecodeDevicesResponse(_ context.Context, r *http.Response) (interface{}, error)

func DecodeGetBlueprintsResponse

func DecodeGetBlueprintsResponse(_ context.Context, r *http.Response) (interface{}, error)

func DecodeGetDEPTokensResponse

func DecodeGetDEPTokensResponse(_ context.Context, r *http.Response) (interface{}, error)

func DecodeGetProfilesResponse

func DecodeGetProfilesResponse(_ context.Context, r *http.Response) (interface{}, error)

func DecodeListAppsResponse

func DecodeListAppsResponse(_ context.Context, r *http.Response) (interface{}, error)

func DecodeListUsersResponse added in v1.2.0

func DecodeListUsersResponse(_ context.Context, r *http.Response) (interface{}, error)

func EncodeError

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

func EncodeHTTPGenericRequest

func EncodeHTTPGenericRequest(_ context.Context, r *http.Request, request interface{}) error

EncodeHTTPGenericRequest is a transport/http.EncodeRequestFunc that JSON-encodes any request to the request body. Primarily useful in a client.

func MakeGetBlueprintsEndpoint

func MakeGetBlueprintsEndpoint(svc Service) endpoint.Endpoint

func MakeGetDEPAccountInfoEndpoint

func MakeGetDEPAccountInfoEndpoint(svc Service) endpoint.Endpoint

func MakeGetDEPDeviceDetailsEndpoint

func MakeGetDEPDeviceDetailsEndpoint(svc Service) endpoint.Endpoint

func MakeGetDEPProfileEndpoint

func MakeGetDEPProfileEndpoint(svc Service) endpoint.Endpoint

func MakeGetDEPTokensEndpoint

func MakeGetDEPTokensEndpoint(svc Service) endpoint.Endpoint

func MakeGetProfilesEndpoint

func MakeGetProfilesEndpoint(svc Service) endpoint.Endpoint

func MakeListAppsEndpoint

func MakeListAppsEndpoint(svc Service) endpoint.Endpoint

func MakeListDevicesEndpoint

func MakeListDevicesEndpoint(svc Service) endpoint.Endpoint

func MakeListUsersEndpoint added in v1.2.0

func MakeListUsersEndpoint(svc Service) endpoint.Endpoint

Types

type AppDTO

type AppDTO struct {
	Name    string `json:"name"`
	Payload []byte `json:"payload,omitempty"`
}

type DEPService

type DEPService interface {
	GetDEPAccountInfo(ctx context.Context) (*dep.Account, error)
	GetDEPDevice(ctx context.Context, serials []string) (*dep.DeviceDetailsResponse, error)
	GetDEPProfile(ctx context.Context, uuid string) (*dep.Profile, error)
}

type DeviceDTO

type DeviceDTO struct {
	SerialNumber     string    `json:"serial_number"`
	UDID             string    `json:"udid"`
	EnrollmentStatus bool      `json:"enrollment_status"`
	LastSeen         time.Time `json:"last_seen"`
}

type Endpoints

type Endpoints struct {
	ListDevicesEndpoint       endpoint.Endpoint
	GetDEPTokensEndpoint      endpoint.Endpoint
	GetBlueprintsEndpoint     endpoint.Endpoint
	GetProfilesEndpoint       endpoint.Endpoint
	GetDEPAccountInfoEndpoint endpoint.Endpoint
	GetDEPDeviceEndpoint      endpoint.Endpoint
	GetDEPProfileEndpoint     endpoint.Endpoint
	ListAppsEndpont           endpoint.Endpoint
	ListUserEndpoint          endpoint.Endpoint
}

func (Endpoints) GetBlueprints

func (e Endpoints) GetBlueprints(ctx context.Context, opt GetBlueprintsOption) ([]blueprint.Blueprint, error)

func (Endpoints) GetDEPAccountInfo

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

func (Endpoints) GetDEPDevice

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

func (Endpoints) GetDEPProfile

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

func (Endpoints) GetDEPTokens

func (e Endpoints) GetDEPTokens(ctx context.Context) ([]deptoken.DEPToken, []byte, error)

func (Endpoints) GetProfiles

func (e Endpoints) GetProfiles(ctx context.Context, opt GetProfilesOption) ([]profile.Profile, error)

func (Endpoints) ListApplications

func (e Endpoints) ListApplications(ctx context.Context, opts ListAppsOption) ([]AppDTO, error)

func (Endpoints) ListDevices

func (e Endpoints) ListDevices(ctx context.Context, opts ListDevicesOption) ([]DeviceDTO, error)

func (Endpoints) ListUsers added in v1.2.0

func (e Endpoints) ListUsers(ctx context.Context, opts ListUsersOption) ([]user.User, error)

type GetBlueprintsOption

type GetBlueprintsOption struct {
	FilterName string
}

type GetProfilesOption

type GetProfilesOption struct {
	Identifier string `json:"id"`
}

type HTTPHandlers

type HTTPHandlers struct {
	ListDevicesHandler         http.Handler
	GetDEPTokensHandler        http.Handler
	GetBlueprintsHandler       http.Handler
	GetProfilesHandler         http.Handler
	GetDEPAccountInfoHandler   http.Handler
	GetDEPProfileHandler       http.Handler
	GetDEPDeviceDetailsHandler http.Handler
	ListAppsHandler            http.Handler
	ListUsersHander            http.Handler
}

func MakeHTTPHandlers

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

type ListAppsOption

type ListAppsOption struct {
	FilterName []string `json:"filter_name"`
}

type ListDevicesOption

type ListDevicesOption struct {
	Page    int
	PerPage int

	FilterSerial []string
	FilterUDID   []string
}

type ListService

type ListService struct {
	DEPClient dep.Client

	Devices    *device.DB
	Blueprints *blueprint.DB
	Profiles   *profile.DB
	Tokens     *deptoken.DB
	Apps       appstore.AppStore
	Users      *user.DB
	// contains filtered or unexported fields
}

func (*ListService) GetBlueprints

func (svc *ListService) GetBlueprints(ctx context.Context, opt GetBlueprintsOption) ([]blueprint.Blueprint, error)

func (*ListService) GetDEPAccountInfo

func (svc *ListService) GetDEPAccountInfo(ctx context.Context) (*dep.Account, error)

func (*ListService) GetDEPDevice

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

func (*ListService) GetDEPProfile

func (svc *ListService) GetDEPProfile(ctx context.Context, uuid string) (*dep.Profile, error)

func (*ListService) GetDEPTokens

func (svc *ListService) GetDEPTokens(ctx context.Context) ([]deptoken.DEPToken, []byte, error)

func (*ListService) GetProfiles

func (svc *ListService) GetProfiles(ctx context.Context, opt GetProfilesOption) ([]profile.Profile, error)

func (*ListService) ListApplications

func (svc *ListService) ListApplications(ctx context.Context, opts ListAppsOption) ([]AppDTO, error)

func (*ListService) ListDevices

func (svc *ListService) ListDevices(ctx context.Context, opt ListDevicesOption) ([]DeviceDTO, error)

func (*ListService) ListUsers added in v1.2.0

func (svc *ListService) ListUsers(ctx context.Context, opts ListUsersOption) ([]user.User, error)

func (*ListService) WatchTokenUpdates

func (svc *ListService) WatchTokenUpdates(pubsub pubsub.Subscriber) error

type ListUsersOption added in v1.2.0

type ListUsersOption struct {
	Page    int
	PerPage int

	FilterUserID []string
	FilterUDID   []string
}

type Service

type Service interface {
	ListDevices(ctx context.Context, opt ListDevicesOption) ([]DeviceDTO, error)
	ListUsers(ctx context.Context, opt ListUsersOption) ([]user.User, error)
	GetDEPTokens(ctx context.Context) ([]deptoken.DEPToken, []byte, error)
	GetBlueprints(ctx context.Context, opt GetBlueprintsOption) ([]blueprint.Blueprint, error)
	GetProfiles(ctx context.Context, opt GetProfilesOption) ([]profile.Profile, error)
	ListApplications(ctx context.Context, opt ListAppsOption) ([]AppDTO, error)
	DEPService
}

func NewClient

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

Jump to

Keyboard shortcuts

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