graphql

package
v0.0.0-...-981ed55 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

THIS CODE IS A STARTING POINT ONLY. IT WILL NOT BE UPDATED WITH SCHEMA CHANGES.

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 {
		ID func(childComplexity int) int
	}

	Entity struct {
		FindDeviceByID func(childComplexity int, id string) int
	}

	Mutation struct {
		AddSnowdepthMeasurement func(childComplexity int, input NewSnowdepthMeasurement) int
	}

	Origin struct {
		Device func(childComplexity int) int
		Pos    func(childComplexity int) int
	}

	Query struct {
		Snowdepths func(childComplexity int) int
		// contains filtered or unexported fields
	}

	Snowdepth struct {
		Depth  func(childComplexity int) int
		From   func(childComplexity int) int
		Manual func(childComplexity int) int
		When   func(childComplexity int) int
	}

	WGS84Position struct {
		Lat func(childComplexity int) int
		Lon func(childComplexity int) int
	}

	Service struct {
		SDL func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type Device

type Device struct {
	ID string `json:"id"`
}

func (Device) IsEntity

func (Device) IsEntity()

type DirectiveRoot

type DirectiveRoot struct {
}

type EntityResolver

type EntityResolver interface {
	FindDeviceByID(ctx context.Context, id string) (*Device, error)
}

type MeasurementPosition

type MeasurementPosition struct {
	Lon float64 `json:"lon"`
	Lat float64 `json:"lat"`
}

type MutationResolver

type MutationResolver interface {
	AddSnowdepthMeasurement(ctx context.Context, input NewSnowdepthMeasurement) (*Snowdepth, error)
}

type NewSnowdepthMeasurement

type NewSnowdepthMeasurement struct {
	Pos   *MeasurementPosition `json:"pos"`
	Depth float64              `json:"depth"`
}

type Origin

type Origin struct {
	Device *Device        `json:"device"`
	Pos    *WGS84Position `json:"pos"`
}

type QueryResolver

type QueryResolver interface {
	Snowdepths(ctx context.Context) ([]*Snowdepth, error)
}

type Resolver

type Resolver struct{}

func (*Resolver) Entity

func (r *Resolver) Entity() EntityResolver

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

type ResolverRoot

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

type Snowdepth

type Snowdepth struct {
	From   *Origin `json:"from"`
	When   string  `json:"when"`
	Depth  float64 `json:"depth"`
	Manual *bool   `json:"manual"`
}

func (Snowdepth) IsTelemetry

func (Snowdepth) IsTelemetry()

type Telemetry

type Telemetry interface {
	IsTelemetry()
}

type WGS84Position

type WGS84Position struct {
	Lon float64 `json:"lon"`
	Lat float64 `json:"lat"`
}

Jump to

Keyboard shortcuts

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