localui

package
v0.0.0-...-d773db1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DocumentOperationNames = map[string]string{}

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

func OpenWebBrowser

func OpenWebBrowser(url string) error

OpenWebBrowser opens the default web browser to a given URL

func Serve

func Serve(opts ...Opt) error

Types

type AvailableNodesResult

type AvailableNodesResult struct {
	Node []string `json:"node"`
}

type Client

type Client struct {
	Client *clientv2.Client
}

func NewClient

func NewClient(cli *http.Client, baseURL string, options *clientv2.Options, interceptors ...clientv2.RequestInterceptor) *Client

type ComplexityRoot

type ComplexityRoot struct {
	AvailableNodesResult struct {
		Node func(childComplexity int) int
	}

	Mutation struct {
		SelectNode func(childComplexity int, node string) int
	}

	Query struct {
		AvailableNodes func(childComplexity int) int
	}

	SelectNodeResult struct {
		MutationID func(childComplexity int) int
	}
}

type Config

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

type DirectiveRoot

type DirectiveRoot struct {
}

type MutationResolver

type MutationResolver interface {
	SelectNode(ctx context.Context, node string) (*SelectNodeResult, error)
}

type Opt

type Opt func(*serveOpts)

func WithBrowser

func WithBrowser(wb bool) Opt

func WithContext

func WithContext(ctx context.Context) Opt

func WithLocalPort

func WithLocalPort(port uint16) Opt

func WithNode

func WithNode(node string) Opt

func WithToken

func WithToken(tok string) Opt

type QueryResolver

type QueryResolver interface {
	AvailableNodes(ctx context.Context) (*AvailableNodesResult, error)
}

type Resolver

type Resolver struct {
	AvailableNodesFunc  func() ([]string, error)
	PreferredSocketFunc func(string) error
}

func (*Resolver) AvailableNodes

func (r *Resolver) AvailableNodes(_ context.Context) (*AvailableNodesResult, error)

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

func (*Resolver) SelectNode

func (r *Resolver) SelectNode(_ context.Context, node string) (*SelectNodeResult, error)

type ResolverRoot

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

type SelectNodeResult

type SelectNodeResult struct {
	MutationID string `json:"mutationID"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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