generated

package
v0.0.0-...-cff5da0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type ComplexityRoot

type ComplexityRoot struct {
	Device struct {
		Elements func(childComplexity int) int
		Type     func(childComplexity int) int
	}

	DeviceResponse struct {
		Addr   func(childComplexity int) int
		Device func(childComplexity int) int
	}

	Element struct {
		Name      func(childComplexity int) int
		State     func(childComplexity int) int
		StateType func(childComplexity int) int
	}

	ElementResponse struct {
		Addr    func(childComplexity int) int
		Element func(childComplexity int) int
	}

	Group struct {
		Devices func(childComplexity int) int
		Name    func(childComplexity int) int
		Scenes  func(childComplexity int) int
	}

	GroupResponse struct {
		Addr  func(childComplexity int) int
		Group func(childComplexity int) int
	}

	Mutation struct {
		AddDevice    func(childComplexity int, groupAddr int, devUUID string, name string) int
		AddGroup     func(childComplexity int, name string) int
		AddUser      func(childComplexity int) int
		ConfigHub    func(childComplexity int) int
		EventBind    func(childComplexity int, sceneNumber int, groupAddr int, devAddr int, elemAddr int) int
		RemoveDevice func(childComplexity int, devAddr int, groupAddr int) int
		RemoveGroup  func(childComplexity int, groupAddr int) int
		ResetHub     func(childComplexity int) int
		SceneDelete  func(childComplexity int, sceneNumber int, groupAddr int) int
		SceneRecall  func(childComplexity int, sceneNumber int, groupAddr int) int
		SceneStore   func(childComplexity int, name string, groupAddr int) int
		SetState     func(childComplexity int, groupAddr int, elemAddr int, value string) int
	}

	Query struct {
		AvailableDevices func(childComplexity int) int
		AvailableGroups  func(childComplexity int) int
		GetUserPin       func(childComplexity int) int
	}

	Scene struct {
		Name func(childComplexity int) int
	}

	SceneResponse struct {
		Number func(childComplexity int) int
		Scene  func(childComplexity int) int
	}

	Subscription struct {
		WatchEvents func(childComplexity int) int
		WatchGroup  func(childComplexity int, groupAddr int) int
		WatchState  func(childComplexity int, groupAddr int, devAddr int, elemAddr int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DeviceResolver

type DeviceResolver interface {
	Elements(ctx context.Context, obj *model.Device) ([]*ElementResponse, error)
}

type DeviceResponse

type DeviceResponse struct {
	Addr   int           `json:"addr"`
	Device *model.Device `json:"device"`
}

type DirectiveRoot

type DirectiveRoot struct {
}

type ElementResolver

type ElementResolver interface {
	State(ctx context.Context, obj *model.Element) (string, error)
}

type ElementResponse

type ElementResponse struct {
	Addr    int            `json:"addr"`
	Element *model.Element `json:"element"`
}

type GroupResolver

type GroupResolver interface {
	Scenes(ctx context.Context, obj *model.Group) ([]*SceneResponse, error)
	Devices(ctx context.Context, obj *model.Group) ([]*DeviceResponse, error)
}

type GroupResponse

type GroupResponse struct {
	Addr  int          `json:"addr"`
	Group *model.Group `json:"group"`
}

type MutationResolver

type MutationResolver interface {
	ConfigHub(ctx context.Context) (string, error)
	ResetHub(ctx context.Context) (bool, error)
	AddDevice(ctx context.Context, groupAddr int, devUUID string, name string) (int, error)
	RemoveDevice(ctx context.Context, devAddr int, groupAddr int) (int, error)
	AddGroup(ctx context.Context, name string) (int, error)
	RemoveGroup(ctx context.Context, groupAddr int) (int, error)
	AddUser(ctx context.Context) (string, error)
	SetState(ctx context.Context, groupAddr int, elemAddr int, value string) (bool, error)
	SceneStore(ctx context.Context, name string, groupAddr int) (int, error)
	SceneRecall(ctx context.Context, sceneNumber int, groupAddr int) (int, error)
	SceneDelete(ctx context.Context, sceneNumber int, groupAddr int) (int, error)
	EventBind(ctx context.Context, sceneNumber int, groupAddr int, devAddr int, elemAddr int) (int, error)
}

type QueryResolver

type QueryResolver interface {
	AvailableDevices(ctx context.Context) ([]string, error)
	AvailableGroups(ctx context.Context) ([]*GroupResponse, error)
	GetUserPin(ctx context.Context) (int, error)
}

type ResolverRoot

type ResolverRoot interface {
	Device() DeviceResolver
	Element() ElementResolver
	Group() GroupResolver
	Mutation() MutationResolver
	Query() QueryResolver
	Subscription() SubscriptionResolver
}

type SceneResponse

type SceneResponse struct {
	Number int          `json:"number"`
	Scene  *model.Scene `json:"scene"`
}

type SubscriptionResolver

type SubscriptionResolver interface {
	WatchGroup(ctx context.Context, groupAddr int) (<-chan *GroupResponse, error)
	WatchState(ctx context.Context, groupAddr int, devAddr int, elemAddr int) (<-chan string, error)
	WatchEvents(ctx context.Context) (<-chan int, error)
}

Jump to

Keyboard shortcuts

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