profile

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 IsNotFound

func IsNotFound(err error) bool

func MakeApplyProfileEndpoint

func MakeApplyProfileEndpoint(svc Service) endpoint.Endpoint

func MakeGetProfilesEndpoint

func MakeGetProfilesEndpoint(svc Service) endpoint.Endpoint

func MakeRemoveProfilesEndpoint

func MakeRemoveProfilesEndpoint(svc Service) endpoint.Endpoint

func MarshalProfile

func MarshalProfile(p *Profile) ([]byte, error)

func RegisterHTTPHandlers

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

func UnmarshalProfile

func UnmarshalProfile(data []byte, p *Profile) error

Types

type Endpoints

type Endpoints struct {
	ApplyProfileEndpoint   endpoint.Endpoint
	GetProfilesEndpoint    endpoint.Endpoint
	RemoveProfilesEndpoint endpoint.Endpoint
}

func MakeServerEndpoints

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

func (Endpoints) ApplyProfile

func (e Endpoints) ApplyProfile(ctx context.Context, p *Profile) error

func (Endpoints) GetProfiles

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

func (Endpoints) RemoveProfiles

func (e Endpoints) RemoveProfiles(ctx context.Context, ids []string) error

type GetProfilesOption

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

type Mobileconfig

type Mobileconfig []byte

func (*Mobileconfig) GetPayloadIdentifier

func (mc *Mobileconfig) GetPayloadIdentifier() (string, error)

type Profile

type Profile struct {
	Identifier   string
	Mobileconfig Mobileconfig
}

func (*Profile) Validate

func (p *Profile) Validate() error

Validate checks the internal consistency and validity of a Profile structure

type ProfileService

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

func New

func New(store Store) *ProfileService

func (*ProfileService) ApplyProfile

func (svc *ProfileService) ApplyProfile(ctx context.Context, p *Profile) error

func (*ProfileService) GetProfiles

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

func (*ProfileService) RemoveProfiles

func (svc *ProfileService) RemoveProfiles(ctx context.Context, ids []string) error

type Service

type Service interface {
	ApplyProfile(ctx context.Context, p *Profile) error
	GetProfiles(ctx context.Context, opt GetProfilesOption) ([]Profile, error)
	RemoveProfiles(ctx context.Context, ids []string) error
}

func NewHTTPClient

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

type Store

type Store interface {
	ProfileById(id string) (*Profile, error)
	Save(p *Profile) error
	List() ([]Profile, error)
	Delete(id string) error
}

Directories

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

Jump to

Keyboard shortcuts

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