resolver

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotImplemented = errors.New("not implemented")
)

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type ComplexityRoot

type ComplexityRoot struct {
	CreatePeerPayload struct {
		ClientMutationID func(childComplexity int) int
		Peer             func(childComplexity int) int
	}

	CreateServerPayload struct {
		ClientMutationID func(childComplexity int) int
		Server           func(childComplexity int) int
	}

	CreateUserPayload struct {
		ClientMutationID func(childComplexity int) int
		User             func(childComplexity int) int
	}

	DeletePeerPayload struct {
		ClientMutationID func(childComplexity int) int
		Peer             func(childComplexity int) int
	}

	DeleteServerPayload struct {
		ClientMutationID func(childComplexity int) int
		Server           func(childComplexity int) int
	}

	DeleteUserPayload struct {
		ClientMutationID func(childComplexity int) int
		User             func(childComplexity int) int
	}

	ForeignInterface struct {
		Addresses func(childComplexity int) int
		Mtu       func(childComplexity int) int
		Name      func(childComplexity int) int
	}

	ForeignPeer struct {
		AllowedIps                  func(childComplexity int) int
		Endpoint                    func(childComplexity int) int
		LastHandshakeTime           func(childComplexity int) int
		PersistentKeepAliveInterval func(childComplexity int) int
		ProtocolVersion             func(childComplexity int) int
		PublicKey                   func(childComplexity int) int
		ReceiveBytes                func(childComplexity int) int
		TransmitBytes               func(childComplexity int) int
	}

	ForeignServer struct {
		FirewallMark     func(childComplexity int) int
		ForeignInterface func(childComplexity int) int
		ListenPort       func(childComplexity int) int
		Name             func(childComplexity int) int
		Peers            func(childComplexity int) int
		PublicKey        func(childComplexity int) int
		Type             func(childComplexity int) int
	}

	GenerateWireguardKeyPayload struct {
		ClientMutationID func(childComplexity int) int
		PrivateKey       func(childComplexity int) int
		PublicKey        func(childComplexity int) int
	}

	ImportForeignServerPayload struct {
		ClientMutationID func(childComplexity int) int
		Server           func(childComplexity int) int
	}

	Mutation struct {
		CreatePeer           func(childComplexity int, input model.CreatePeerInput) int
		CreateServer         func(childComplexity int, input model.CreateServerInput) int
		CreateUser           func(childComplexity int, input model.CreateUserInput) int
		DeletePeer           func(childComplexity int, input model.DeletePeerInput) int
		DeleteServer         func(childComplexity int, input model.DeleteServerInput) int
		DeleteUser           func(childComplexity int, input model.DeleteUserInput) int
		GenerateWireguardKey func(childComplexity int, input model.GenerateWireguardKeyInput) int
		ImportForeignServer  func(childComplexity int, input model.ImportForeignServerInput) int
		SignIn               func(childComplexity int, input model.SignInInput) int
		StartServer          func(childComplexity int, input model.StartServerInput) int
		StopServer           func(childComplexity int, input model.StopServerInput) int
		UpdatePeer           func(childComplexity int, input model.UpdatePeerInput) int
		UpdateServer         func(childComplexity int, input model.UpdateServerInput) int
		UpdateUser           func(childComplexity int, input model.UpdateUserInput) int
	}

	Peer struct {
		AllowedIPs          func(childComplexity int) int
		CreateUser          func(childComplexity int) int
		CreatedAt           func(childComplexity int) int
		DeleteUser          func(childComplexity int) int
		DeletedAt           func(childComplexity int) int
		Description         func(childComplexity int) int
		Endpoint            func(childComplexity int) int
		Hooks               func(childComplexity int) int
		ID                  func(childComplexity int) int
		Name                func(childComplexity int) int
		PersistentKeepalive func(childComplexity int) int
		PresharedKey        func(childComplexity int) int
		PublicKey           func(childComplexity int) int
		Server              func(childComplexity int) int
		Stats               func(childComplexity int) int
		UpdateUser          func(childComplexity int) int
		UpdatedAt           func(childComplexity int) int
	}

	PeerChangedEvent struct {
		Action func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	PeerHook struct {
		Command     func(childComplexity int) int
		RunOnCreate func(childComplexity int) int
		RunOnDelete func(childComplexity int) int
		RunOnUpdate func(childComplexity int) int
	}

	PeerStats struct {
		LastHandshakeTime func(childComplexity int) int
		ProtocolVersion   func(childComplexity int) int
		ReceiveBytes      func(childComplexity int) int
		TransmitBytes     func(childComplexity int) int
	}

	Query struct {
		ForeignServers func(childComplexity int) int
		Node           func(childComplexity int, id model.ID) int
		Nodes          func(childComplexity int, ids []*model.ID) int
		Peers          func(childComplexity int, query *string) int
		Servers        func(childComplexity int, query *string, enabled *bool) int
		Users          func(childComplexity int, query *string) int
		Viewer         func(childComplexity int) int
	}

	Server struct {
		Address        func(childComplexity int) int
		CreateUser     func(childComplexity int) int
		CreatedAt      func(childComplexity int) int
		DNS            func(childComplexity int) int
		DeleteUser     func(childComplexity int) int
		DeletedAt      func(childComplexity int) int
		Description    func(childComplexity int) int
		Enabled        func(childComplexity int) int
		FirewallMark   func(childComplexity int) int
		Hooks          func(childComplexity int) int
		ID             func(childComplexity int) int
		InterfaceStats func(childComplexity int) int
		ListenPort     func(childComplexity int) int
		Mtu            func(childComplexity int) int
		Name           func(childComplexity int) int
		Peers          func(childComplexity int) int
		PublicKey      func(childComplexity int) int
		Running        func(childComplexity int) int
		UpdateUser     func(childComplexity int) int
		UpdatedAt      func(childComplexity int) int
	}

	ServerChangedEvent struct {
		Action func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	ServerHook struct {
		Command     func(childComplexity int) int
		RunOnCreate func(childComplexity int) int
		RunOnDelete func(childComplexity int) int
		RunOnStart  func(childComplexity int) int
		RunOnStop   func(childComplexity int) int
		RunOnUpdate func(childComplexity int) int
	}

	ServerInterfaceStats struct {
		Collisions        func(childComplexity int) int
		Multicast         func(childComplexity int) int
		RxBytes           func(childComplexity int) int
		RxCompressed      func(childComplexity int) int
		RxCrcErrors       func(childComplexity int) int
		RxDropped         func(childComplexity int) int
		RxErrors          func(childComplexity int) int
		RxFifoErrors      func(childComplexity int) int
		RxFrameErrors     func(childComplexity int) int
		RxLengthErrors    func(childComplexity int) int
		RxMissedErrors    func(childComplexity int) int
		RxOverErrors      func(childComplexity int) int
		RxPackets         func(childComplexity int) int
		TxAbortedErrors   func(childComplexity int) int
		TxBytes           func(childComplexity int) int
		TxCarrierErrors   func(childComplexity int) int
		TxCompressed      func(childComplexity int) int
		TxDropped         func(childComplexity int) int
		TxErrors          func(childComplexity int) int
		TxFifoErrors      func(childComplexity int) int
		TxHeartbeatErrors func(childComplexity int) int
		TxPackets         func(childComplexity int) int
		TxWindowErrors    func(childComplexity int) int
	}

	SignInPayload struct {
		ClientMutationID func(childComplexity int) int
		ExpiresAt        func(childComplexity int) int
		ExpiresIn        func(childComplexity int) int
		Token            func(childComplexity int) int
	}

	StartServerPayload struct {
		ClientMutationID func(childComplexity int) int
		Server           func(childComplexity int) int
	}

	StopServerPayload struct {
		ClientMutationID func(childComplexity int) int
		Server           func(childComplexity int) int
	}

	Subscription struct {
		NodeChanged   func(childComplexity int) int
		PeerChanged   func(childComplexity int) int
		ServerChanged func(childComplexity int) int
		UserChanged   func(childComplexity int) int
	}

	UpdatePeerPayload struct {
		ClientMutationID func(childComplexity int) int
		Peer             func(childComplexity int) int
	}

	UpdateServerPayload struct {
		ClientMutationID func(childComplexity int) int
		Server           func(childComplexity int) int
	}

	UpdateUserPayload struct {
		ClientMutationID func(childComplexity int) int
		User             func(childComplexity int) int
	}

	User struct {
		CreatedAt func(childComplexity int) int
		Email     func(childComplexity int) int
		ID        func(childComplexity int) int
		Peers     func(childComplexity int) int
		Servers   func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
	}

	UserChangedEvent struct {
		Action func(childComplexity int) int
		Node   func(childComplexity int) int
	}
}

type Config

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

type DirectiveRoot

type DirectiveRoot struct {
	Authenticated func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
}

type PeerResolver

type PeerResolver interface {
	Server(ctx context.Context, obj *model.Peer) (*model.Server, error)

	Stats(ctx context.Context, obj *model.Peer) (*model.PeerStats, error)
	CreateUser(ctx context.Context, obj *model.Peer) (*model.User, error)
	UpdateUser(ctx context.Context, obj *model.Peer) (*model.User, error)
	DeleteUser(ctx context.Context, obj *model.Peer) (*model.User, error)
}

type QueryResolver

type QueryResolver interface {
	Viewer(ctx context.Context) (*model.User, error)
	Node(ctx context.Context, id model.ID) (model.Node, error)
	Nodes(ctx context.Context, ids []*model.ID) ([]model.Node, error)
	Users(ctx context.Context, query *string) ([]*model.User, error)
	Servers(ctx context.Context, query *string, enabled *bool) ([]*model.Server, error)
	Peers(ctx context.Context, query *string) ([]*model.Peer, error)
	ForeignServers(ctx context.Context) ([]*model.ForeignServer, error)
}

type ResolverRoot

type ResolverRoot interface {
	Mutation() MutationResolver
	Peer() PeerResolver
	Query() QueryResolver
	Server() ServerResolver
	Subscription() SubscriptionResolver
	User() UserResolver
}

type ServerResolver

type ServerResolver interface {
	Peers(ctx context.Context, obj *model.Server) ([]*model.Peer, error)

	CreateUser(ctx context.Context, obj *model.Server) (*model.User, error)
	UpdateUser(ctx context.Context, obj *model.Server) (*model.User, error)
	DeleteUser(ctx context.Context, obj *model.Server) (*model.User, error)
}

type SubscriptionResolver

type SubscriptionResolver interface {
	UserChanged(ctx context.Context) (<-chan *model.UserChangedEvent, error)
	ServerChanged(ctx context.Context) (<-chan *model.ServerChangedEvent, error)
	PeerChanged(ctx context.Context) (<-chan *model.PeerChangedEvent, error)
	NodeChanged(ctx context.Context) (<-chan model.NodeChangedEvent, error)
}

type UserResolver

type UserResolver interface {
	Servers(ctx context.Context, obj *model.User) ([]*model.Server, error)
	Peers(ctx context.Context, obj *model.User) ([]*model.Peer, error)
}

Jump to

Keyboard shortcuts

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