graph

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: GPL-3.0 Imports: 15 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 {
	HMachine struct {
		ForcedTags  func(childComplexity int) int
		GivenName   func(childComplexity int) int
		ID          func(childComplexity int) int
		IPAddresses func(childComplexity int) int
		LastSeen    func(childComplexity int) int
		Name        func(childComplexity int) int
		Online      func(childComplexity int) int
		Routes      func(childComplexity int) int
		User        func(childComplexity int) int
	}

	HMachineMutation struct {
		DeleteMachine  func(childComplexity int, machineID int) int
		RenameMachine  func(childComplexity int, machineID int, name string) int
		SetMachineTags func(childComplexity int, machineID int, tags []string) int
	}

	HRoute struct {
		Advertised func(childComplexity int) int
		CreatedAt  func(childComplexity int) int
		DeletedAt  func(childComplexity int) int
		Enabled    func(childComplexity int) int
		ID         func(childComplexity int) int
		IsPrimary  func(childComplexity int) int
		Machine    func(childComplexity int) int
		Prefix     func(childComplexity int) int
		UpdatedAt  func(childComplexity int) int
	}

	HRouteMutation struct {
		DeleteRoute func(childComplexity int, routeID int) int
		EnableRoute func(childComplexity int, routeID int, enable bool) int
	}

	HUser struct {
		ID   func(childComplexity int) int
		Name func(childComplexity int) int
	}

	HeadscaleMutation struct {
		Machine func(childComplexity int) int
		Route   func(childComplexity int) int
	}

	HeadscaleQuery struct {
		Machine  func(childComplexity int, machineID int) int
		Machines func(childComplexity int) int
	}

	Machine struct {
		ID   func(childComplexity int) int
		Name func(childComplexity int) int
	}

	MachineMutation struct {
		DeleteMachine func(childComplexity int, id string) int
		SaveMachine   func(childComplexity int, machineInput *model.MachineInput) int
	}

	Mutation struct {
		Headscale func(childComplexity int) int
		Machine   func(childComplexity int) int
		Project   func(childComplexity int) int
		Route     func(childComplexity int) int
	}

	Project struct {
		Code       func(childComplexity int) int
		ID         func(childComplexity int) int
		Machine    func(childComplexity int) int
		MachineID  func(childComplexity int) int
		MachineIDs func(childComplexity int) int
		Machines   func(childComplexity int) int
		Name       func(childComplexity int) int
		Routes     func(childComplexity int) int
	}

	ProjectMutation struct {
		DeleteProject    func(childComplexity int, id string) int
		SaveProject      func(childComplexity int, projectInput *model.ProjectInput) int
		SyncProjectRoute func(childComplexity int, projectID *string) int
	}

	Query struct {
		Headscale func(childComplexity int) int
		Machines  func(childComplexity int) int
		Projects  func(childComplexity int) int
		Routes    func(childComplexity int) int
	}

	Route struct {
		Description func(childComplexity int) int
		ID          func(childComplexity int) int
		Name        func(childComplexity int) int
		Project     func(childComplexity int) int
		ProjectID   func(childComplexity int) int
	}

	RouteMutation struct {
		DeleteRoute func(childComplexity int, id string) int
		SaveRoute   func(childComplexity int, routeInput *model.RouteInput) int
	}

	SyncResult struct {
		Machine     func(childComplexity int) int
		MachineID   func(childComplexity int) int
		Project     func(childComplexity int) int
		ProjectID   func(childComplexity int) int
		Route       func(childComplexity int) int
		RouteEnable func(childComplexity int) int
		RouteID     func(childComplexity int) int
	}

	Timestamp struct {
		Nanos   func(childComplexity int) int
		Seconds func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type HMachineMutationResolver added in v1.1.0

type HMachineMutationResolver interface {
	RenameMachine(ctx context.Context, obj *model.HMachineMutation, machineID int, name string) (*model.HMachine, error)
	DeleteMachine(ctx context.Context, obj *model.HMachineMutation, machineID int) (bool, error)
	SetMachineTags(ctx context.Context, obj *model.HMachineMutation, machineID int, tags []string) (*model.HMachine, error)
}

type HMachineResolver added in v1.1.0

type HMachineResolver interface {
	Routes(ctx context.Context, obj *model.HMachine) ([]*model.HRoute, error)
}

type HRouteMutationResolver added in v1.1.0

type HRouteMutationResolver interface {
	EnableRoute(ctx context.Context, obj *model.HRouteMutation, routeID int, enable bool) (bool, error)
	DeleteRoute(ctx context.Context, obj *model.HRouteMutation, routeID int) (bool, error)
}

type HRouteResolver added in v1.1.0

type HRouteResolver interface {
	Machine(ctx context.Context, obj *model.HRoute) (*model.HMachine, error)
}

type HeadscaleQueryResolver added in v1.1.0

type HeadscaleQueryResolver interface {
	Machines(ctx context.Context, obj *model.HeadscaleQuery) ([]*model.HMachine, error)
	Machine(ctx context.Context, obj *model.HeadscaleQuery, machineID int) (*model.HMachine, error)
}

type MachineMutationResolver

type MachineMutationResolver interface {
	SaveMachine(ctx context.Context, obj *model.MachineMutation, machineInput *model.MachineInput) (*model.Machine, error)
	DeleteMachine(ctx context.Context, obj *model.MachineMutation, id string) (int, error)
}

type MutationResolver

type MutationResolver interface {
	Project(ctx context.Context) (*model.ProjectMutation, error)
	Route(ctx context.Context) (*model.RouteMutation, error)
	Machine(ctx context.Context) (*model.MachineMutation, error)
	Headscale(ctx context.Context) (*model.HeadscaleMutation, error)
}

type ProjectMutationResolver

type ProjectMutationResolver interface {
	SaveProject(ctx context.Context, obj *model.ProjectMutation, projectInput *model.ProjectInput) (*model.Project, error)
	DeleteProject(ctx context.Context, obj *model.ProjectMutation, id string) (int, error)
	SyncProjectRoute(ctx context.Context, obj *model.ProjectMutation, projectID *string) ([]*model.SyncResult, error)
}

type ProjectResolver

type ProjectResolver interface {
	Machine(ctx context.Context, obj *model.Project) (*model.Machine, error)
	Machines(ctx context.Context, obj *model.Project) ([]*model.Machine, error)

	Routes(ctx context.Context, obj *model.Project) ([]*model.Route, error)
}

type QueryResolver

type QueryResolver interface {
	Projects(ctx context.Context) ([]*model.Project, error)
	Machines(ctx context.Context) ([]*model.Machine, error)
	Routes(ctx context.Context) ([]*model.Route, error)
	Headscale(ctx context.Context) (*model.HeadscaleQuery, error)
}

type Resolver

type Resolver struct{}

func (*Resolver) HMachine added in v1.1.0

func (r *Resolver) HMachine() HMachineResolver

HMachine returns HMachineResolver implementation.

func (*Resolver) HMachineMutation added in v1.1.0

func (r *Resolver) HMachineMutation() HMachineMutationResolver

HMachineMutation returns HMachineMutationResolver implementation.

func (*Resolver) HRoute added in v1.1.0

func (r *Resolver) HRoute() HRouteResolver

HRoute returns HRouteResolver implementation.

func (*Resolver) HRouteMutation added in v1.1.0

func (r *Resolver) HRouteMutation() HRouteMutationResolver

HRouteMutation returns HRouteMutationResolver implementation.

func (*Resolver) HeadscaleQuery added in v1.1.0

func (r *Resolver) HeadscaleQuery() HeadscaleQueryResolver

HeadscaleQuery returns HeadscaleQueryResolver implementation.

func (*Resolver) MachineMutation

func (r *Resolver) MachineMutation() MachineMutationResolver

MachineMutation returns MachineMutationResolver implementation.

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

Mutation returns MutationResolver implementation.

func (*Resolver) Project

func (r *Resolver) Project() ProjectResolver

Project returns ProjectResolver implementation.

func (*Resolver) ProjectMutation

func (r *Resolver) ProjectMutation() ProjectMutationResolver

ProjectMutation returns ProjectMutationResolver implementation.

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

Query returns QueryResolver implementation.

func (*Resolver) Route

func (r *Resolver) Route() RouteResolver

Route returns RouteResolver implementation.

func (*Resolver) RouteMutation

func (r *Resolver) RouteMutation() RouteMutationResolver

RouteMutation returns RouteMutationResolver implementation.

func (*Resolver) SyncResult

func (r *Resolver) SyncResult() SyncResultResolver

SyncResult returns SyncResultResolver implementation.

type ResolverRoot

type ResolverRoot interface {
	HMachine() HMachineResolver
	HMachineMutation() HMachineMutationResolver
	HRoute() HRouteResolver
	HRouteMutation() HRouteMutationResolver
	HeadscaleQuery() HeadscaleQueryResolver
	MachineMutation() MachineMutationResolver
	Mutation() MutationResolver
	Project() ProjectResolver
	ProjectMutation() ProjectMutationResolver
	Query() QueryResolver
	Route() RouteResolver
	RouteMutation() RouteMutationResolver
	SyncResult() SyncResultResolver
}

type RouteMutationResolver

type RouteMutationResolver interface {
	SaveRoute(ctx context.Context, obj *model.RouteMutation, routeInput *model.RouteInput) (*model.Route, error)
	DeleteRoute(ctx context.Context, obj *model.RouteMutation, id string) (int, error)
}

type RouteResolver

type RouteResolver interface {
	Project(ctx context.Context, obj *model.Route) (*model.Project, error)
}

type SyncResultResolver

type SyncResultResolver interface {
	Project(ctx context.Context, obj *model.SyncResult) (*model.Project, error)

	Route(ctx context.Context, obj *model.SyncResult) (*model.Route, error)

	Machine(ctx context.Context, obj *model.SyncResult) (*model.Machine, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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