graph

package
v1.1.22 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 19 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.

func PlaygroundHandler

func PlaygroundHandler(title, endpoint string) http.HandlerFunc

PlaygroundHandler returns a handler that serves the GraphQL Playground with custom examples

Types

type ComplexityRoot

type ComplexityRoot struct {
	Placement struct {
		Annotations func(childComplexity int) int
		CreatedAt   func(childComplexity int) int
		ID          func(childComplexity int) int
		Request     func(childComplexity int) int
		Resources   func(childComplexity int) int
		ServiceUUID func(childComplexity int) int
		Status      func(childComplexity int) int
		ToCleanup   func(childComplexity int) int
		UpdatedAt   func(childComplexity int) int
	}

	Query struct {
		Placement              func(childComplexity int, id int) int
		PlacementByServiceUUID func(childComplexity int, serviceUUID string) int
		Placements             func(childComplexity int, status *string, serviceUUID *string, toCleanup *bool, annotations map[string]any, limit *int, offset *int) int
	}
}

type Config

type Config struct {
	Schema     *ast.Schema
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type PlacementResolver

type PlacementResolver interface {
	Resources(ctx context.Context, obj *model.Placement) ([]any, error)
}

type QueryResolver

type QueryResolver interface {
	Placements(ctx context.Context, status *string, serviceUUID *string, toCleanup *bool, annotations map[string]any, limit *int, offset *int) ([]*model.Placement, error)
	Placement(ctx context.Context, id int) (*model.Placement, error)
	PlacementByServiceUUID(ctx context.Context, serviceUUID string) (*model.Placement, error)
}

type Resolver

type Resolver struct {
	DbPool      *pgxpool.Pool
	AwsProvider models.AwsAccountProvider
	OcpProvider models.OcpSandboxProvider
	DnsProvider models.DNSSandboxProvider
	IbmProvider models.IBMResourceGroupSandboxProvider
}

func (*Resolver) Placement

func (r *Resolver) Placement() PlacementResolver

Placement returns PlacementResolver implementation.

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

Query returns QueryResolver implementation.

type ResolverRoot

type ResolverRoot interface {
	Placement() PlacementResolver
	Query() QueryResolver
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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