graphql_models

package
v0.0.0-...-d4113f3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type ComplexityRoot

type ComplexityRoot struct {
	InfectionAlert struct {
		HowManyEncounters func(childComplexity int) int
		Risk              func(childComplexity int) int
	}

	InfectionCreateKey struct {
		Key      func(childComplexity int) int
		Password func(childComplexity int) int
	}

	Mutation struct {
		CreateDeviceKey                      func(childComplexity int, input DeviceKeyCreateInput) int
		CreateInfectedEncounters             func(childComplexity int, input InfectedEncountersCreateInput) int
		CreateInfectionCreateKey             func(childComplexity int, singleSignOnKey string, singleSignOnSecondKey string) int
		CreateInfectionCreateKeyUnauthorized func(childComplexity int) int
		DeleteInfectedEncountersOnKeys       func(childComplexity int, keys []*DeviceKeyParam) int
		RemoveDeviceKeys                     func(childComplexity int, keys []*DeviceKeyParam) int
	}

	OkPayload struct {
		Ok func(childComplexity int) int
	}

	Query struct {
		InfectedEncounters func(childComplexity int, deviceHashesOfMyOwn []*DeviceKeyParam) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DeviceKeyCreateInput

type DeviceKeyCreateInput struct {
	Hash     string `json:"hash"`
	Password string `json:"password"`
	Time     int    `json:"time"`
}

type DeviceKeyParam

type DeviceKeyParam struct {
	Hash     string `json:"hash"`
	Password string `json:"password"`
}

type DirectiveRoot

type DirectiveRoot struct {
}

type InfectedEncounterCreateInput

type InfectedEncounterCreateInput struct {
	PossibleInfectedHash string `json:"possibleInfectedHash"`
	Rssi                 int    `json:"rssi"`
	Hits                 int    `json:"hits"`
	Time                 int    `json:"time"`
	Duration             int    `json:"duration"`
}

type InfectedEncountersCreateInput

type InfectedEncountersCreateInput struct {
	InfectionCreateKey *InfectionCreateKeyInput        `json:"infectionCreateKey"`
	InfectedEncounters []*InfectedEncounterCreateInput `json:"infectedEncounters"`
}

type InfectionAlert

type InfectionAlert struct {
	HowManyEncounters int  `json:"howManyEncounters"`
	Risk              Risk `json:"risk"`
}

type InfectionCreateKey

type InfectionCreateKey struct {
	Key      string `json:"key"`
	Password string `json:"password"`
}

type InfectionCreateKeyInput

type InfectionCreateKeyInput struct {
	Key      string `json:"key"`
	Password string `json:"password"`
}

type MutationResolver

type MutationResolver interface {
	CreateInfectedEncounters(ctx context.Context, input InfectedEncountersCreateInput) (*OkPayload, error)
	CreateDeviceKey(ctx context.Context, input DeviceKeyCreateInput) (*OkPayload, error)
	DeleteInfectedEncountersOnKeys(ctx context.Context, keys []*DeviceKeyParam) (*OkPayload, error)
	RemoveDeviceKeys(ctx context.Context, keys []*DeviceKeyParam) (*OkPayload, error)
	CreateInfectionCreateKey(ctx context.Context, singleSignOnKey string, singleSignOnSecondKey string) (*InfectionCreateKey, error)
	CreateInfectionCreateKeyUnauthorized(ctx context.Context) (*InfectionCreateKey, error)
}

type OkPayload

type OkPayload struct {
	Ok bool `json:"ok"`
}

type QueryResolver

type QueryResolver interface {
	InfectedEncounters(ctx context.Context, deviceHashesOfMyOwn []*DeviceKeyParam) ([]*InfectionAlert, error)
}

type ResolverRoot

type ResolverRoot interface {
	Mutation() MutationResolver
	Query() QueryResolver
}

type Risk

type Risk string
const (
	RiskHighRisk   Risk = "HIGH_RISK"
	RiskMiddleRisk Risk = "MIDDLE_RISK"
	RiskLowRisk    Risk = "LOW_RISK"
)

func (Risk) IsValid

func (e Risk) IsValid() bool

func (Risk) MarshalGQL

func (e Risk) MarshalGQL(w io.Writer)

func (Risk) String

func (e Risk) String() string

func (*Risk) UnmarshalGQL

func (e *Risk) UnmarshalGQL(v interface{}) error

Jump to

Keyboard shortcuts

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