blueprint

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

Documentation

Index

Constants

View Source
const (
	ApplyAtEnroll string = "Enroll"
)

ApplyAt is a case-insensitive string that specifies at which point the system should apply a Blueprint to devices. For example if a Blueprint has an ApplyAt of "Enroll" then that profile will be applied immediately after a device's enrollment in the MDM system. Currently "Enroll" is the only supported value but more are planned.

Variables

This section is empty.

Functions

func MakeApplyBlueprintEndpoint

func MakeApplyBlueprintEndpoint(svc Service) endpoint.Endpoint

func MakeGetBlueprintsEndpoint

func MakeGetBlueprintsEndpoint(svc Service) endpoint.Endpoint

func MakeRemoveBlueprintsEndpoint

func MakeRemoveBlueprintsEndpoint(svc Service) endpoint.Endpoint

func MarshalBlueprint

func MarshalBlueprint(bp *Blueprint) ([]byte, error)

func RegisterHTTPHandlers

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

func UnmarshalBlueprint

func UnmarshalBlueprint(data []byte, bp *Blueprint) error

Types

type Blueprint

type Blueprint struct {
	UUID                                string   `json:"uuid"`
	Name                                string   `json:"name"`
	ApplicationURLs                     []string `json:"install_application_manifest_urls"`
	ProfileIdentifiers                  []string `json:"profile_ids"`
	UserUUID                            []string `json:"user_uuids"`
	SkipPrimarySetupAccountCreation     bool     `json:"skip_primary_setup_account_creation"`
	SetPrimarySetupAccountAsRegularUser bool     `json:"set_primary_setup_account_as_regular_user"`
	ApplyAt                             []string `json:"apply_at"`
}

func (*Blueprint) Verify

func (bp *Blueprint) Verify() error

type BlueprintService

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

func New

func New(store Store) *BlueprintService

func (*BlueprintService) ApplyBlueprint

func (svc *BlueprintService) ApplyBlueprint(ctx context.Context, bp *Blueprint) error

func (*BlueprintService) GetBlueprints

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

func (*BlueprintService) RemoveBlueprints

func (svc *BlueprintService) RemoveBlueprints(ctx context.Context, names []string) error

type BlueprintWorkerStore

type BlueprintWorkerStore interface {
	BlueprintsByApplyAt(ctx context.Context, action string) ([]Blueprint, error)
}

type Endpoints

type Endpoints struct {
	ApplyBlueprintEndpoint   endpoint.Endpoint
	GetBlueprintsEndpoint    endpoint.Endpoint
	RemoveBlueprintsEndpoint endpoint.Endpoint
}

func MakeServerEndpoints

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

func (Endpoints) ApplyBlueprint

func (e Endpoints) ApplyBlueprint(ctx context.Context, bp *Blueprint) error

func (Endpoints) GetBlueprints

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

func (Endpoints) RemoveBlueprints

func (e Endpoints) RemoveBlueprints(ctx context.Context, names []string) error

type GetBlueprintsOption

type GetBlueprintsOption struct {
	FilterName string
}

type ProfileStore

type ProfileStore interface {
	ProfileById(ctx context.Context, id string) (*profile.Profile, error)
}

type Service

type Service interface {
	ApplyBlueprint(ctx context.Context, bp *Blueprint) error
	GetBlueprints(ctx context.Context, opt GetBlueprintsOption) ([]Blueprint, error)
	RemoveBlueprints(ctx context.Context, names []string) error
}

func NewHTTPClient

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

type Store

type Store interface {
	Save(*Blueprint) error
	BlueprintByName(name string) (*Blueprint, error)
	List() ([]Blueprint, error)
	Delete(string) error
}

type UserStore

type UserStore interface {
	User(ctx context.Context, uuid string) (*user.User, error)
}

type Worker

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

func NewWorker

func NewWorker(
	db BlueprintWorkerStore,
	userDB UserStore,
	profileDB ProfileStore,
	cmdsvc command.Service,
	sub pubsub.Subscriber,
	logger log.Logger,
) *Worker

func (*Worker) Run

func (w *Worker) Run(ctx context.Context) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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