Documentation ¶
Index ¶
- Variables
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func NewSchema() graphql.ExecutableSchema
- type ACLMutationResolver
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type HMachineMutationResolver
- type HMachineResolver
- type HRouteMutationResolver
- type HRouteResolver
- type HUserMutationResolver
- type HeadscaleQueryResolver
- type MachineMutationResolver
- type MutationResolver
- type NeedAdmind
- type ProjectMutationResolver
- type ProjectResolver
- type QueryResolver
- type Resolver
- func (r *Resolver) ACLMutation() ACLMutationResolver
- func (r *Resolver) HMachine() HMachineResolver
- func (r *Resolver) HMachineMutation() HMachineMutationResolver
- func (r *Resolver) HRoute() HRouteResolver
- func (r *Resolver) HRouteMutation() HRouteMutationResolver
- func (r *Resolver) HUserMutation() HUserMutationResolver
- func (r *Resolver) HeadscaleQuery() HeadscaleQueryResolver
- func (r *Resolver) MachineMutation() MachineMutationResolver
- func (r *Resolver) Mutation() MutationResolver
- func (r *Resolver) Project() ProjectResolver
- func (r *Resolver) ProjectMutation() ProjectMutationResolver
- func (r *Resolver) Query() QueryResolver
- func (r *Resolver) Route() RouteResolver
- func (r *Resolver) RouteMutation() RouteMutationResolver
- func (r *Resolver) SyncResult() SyncResultResolver
- func (r *Resolver) UserInfo() UserInfoResolver
- type ResolverRoot
- type RouteMutationResolver
- type RouteResolver
- type SyncResultResolver
- type UserInfoResolver
Constants ¶
This section is empty.
Variables ¶
var ErrNotAdmin = errors.New("you are not admin")
Functions ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func NewSchema ¶ added in v1.3.0
func NewSchema() graphql.ExecutableSchema
Types ¶
type ACLMutationResolver ¶ added in v1.3.1
type ComplexityRoot ¶
type ComplexityRoot struct { ACLMutation struct { TriggerUpdate func(childComplexity int) int } 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 MoveMachine func(childComplexity int, machineID int, userName string) 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 { CreatedAt func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int } HUserMutation struct { CreateUser func(childComplexity int, name string) int DeleteUser func(childComplexity int, name string) int RenameUser func(childComplexity int, oldName string, newName string) int } HeadscaleMutation struct { Machine func(childComplexity int) int Route func(childComplexity int) int User func(childComplexity int) int } HeadscaleQuery struct { Machine func(childComplexity int, machineID int) int Machines func(childComplexity int) int Users 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 { ACL func(childComplexity int) int 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 UserInfo 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 } UserInfo struct { Email func(childComplexity int) int Groups func(childComplexity int) int IsAdmin func(childComplexity int) int Name func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
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) MoveMachine(ctx context.Context, obj *model.HMachineMutation, machineID int, userName string) (*model.HMachine, error) }
type HMachineResolver ¶ added in v1.1.0
type HRouteMutationResolver ¶ added in v1.1.0
type HRouteResolver ¶ added in v1.1.0
type HUserMutationResolver ¶ added in v1.2.0
type HUserMutationResolver interface { CreateUser(ctx context.Context, obj *model.HUserMutation, name string) (*model.HUser, error) DeleteUser(ctx context.Context, obj *model.HUserMutation, name string) (bool, error) RenameUser(ctx context.Context, obj *model.HUserMutation, oldName string, newName string) (*model.HUser, error) }
type HeadscaleQueryResolver ¶ added in v1.1.0
type MachineMutationResolver ¶
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) ACL(ctx context.Context) (*model.ACLMutation, error) }
type NeedAdmind ¶ added in v1.3.0
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 QueryResolver ¶
type QueryResolver interface { UserInfo(ctx context.Context) (*model.UserInfo, error) 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) ACLMutation ¶ added in v1.3.1
func (r *Resolver) ACLMutation() ACLMutationResolver
ACLMutation returns ACLMutationResolver implementation.
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) HUserMutation ¶ added in v1.2.0
func (r *Resolver) HUserMutation() HUserMutationResolver
HUserMutation returns HUserMutationResolver 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.
func (*Resolver) UserInfo ¶ added in v1.3.0
func (r *Resolver) UserInfo() UserInfoResolver
UserInfo returns UserInfoResolver implementation.
type ResolverRoot ¶
type ResolverRoot interface { ACLMutation() ACLMutationResolver HMachine() HMachineResolver HMachineMutation() HMachineMutationResolver HRoute() HRouteResolver HRouteMutation() HRouteMutationResolver HUserMutation() HUserMutationResolver HeadscaleQuery() HeadscaleQueryResolver MachineMutation() MachineMutationResolver Mutation() MutationResolver Project() ProjectResolver ProjectMutation() ProjectMutationResolver Query() QueryResolver Route() RouteResolver RouteMutation() RouteMutationResolver SyncResult() SyncResultResolver UserInfo() UserInfoResolver }