generated

package
v0.0.0-...-e59a564 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 21 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 BlueprintResolver

type BlueprintResolver interface {
	BlueprintTemplate(ctx context.Context, obj *ent.Blueprint) (string, error)

	Provider(ctx context.Context, obj *ent.Blueprint) (*ent.Provider, error)
	Project(ctx context.Context, obj *ent.Blueprint) (*ent.Project, error)
	Resources(ctx context.Context, obj *ent.Blueprint) ([]*ent.Resource, error)
	Deployments(ctx context.Context, obj *ent.Blueprint) ([]*ent.Deployment, error)
}

type ComplexityRoot

type ComplexityRoot struct {
	Blueprint struct {
		BlueprintTemplate func(childComplexity int) int
		CreatedAt         func(childComplexity int) int
		Deployments       func(childComplexity int) int
		Description       func(childComplexity int) int
		ID                func(childComplexity int) int
		Name              func(childComplexity int) int
		Project           func(childComplexity int) int
		Provider          func(childComplexity int) int
		Resources         func(childComplexity int) int
		UpdatedAt         func(childComplexity int) int
		VariableTypes     func(childComplexity int) int
	}

	BlueprintPage struct {
		Blueprints func(childComplexity int) int
		Total      func(childComplexity int) int
	}

	Deployment struct {
		Blueprint       func(childComplexity int) int
		CreatedAt       func(childComplexity int) int
		DeploymentNodes func(childComplexity int) int
		Description     func(childComplexity int) int
		ExpiresAt       func(childComplexity int) int
		ID              func(childComplexity int) int
		Name            func(childComplexity int) int
		Project         func(childComplexity int) int
		Requester       func(childComplexity int) int
		State           func(childComplexity int) int
		TemplateVars    func(childComplexity int) int
		UpdatedAt       func(childComplexity int) int
	}

	DeploymentNode struct {
		CreatedAt  func(childComplexity int) int
		Deployment func(childComplexity int) int
		ID         func(childComplexity int) int
		NextNodes  func(childComplexity int) int
		PrevNodes  func(childComplexity int) int
		Resource   func(childComplexity int) int
		State      func(childComplexity int) int
		UpdatedAt  func(childComplexity int) int
		Vars       func(childComplexity int) int
	}

	DeploymentPage struct {
		Deployments func(childComplexity int) int
		Total       func(childComplexity int) int
	}

	GrantedPermission struct {
		Action        func(childComplexity int) int
		CreatedAt     func(childComplexity int) int
		DisplayString func(childComplexity int) int
		ID            func(childComplexity int) int
		ObjectID      func(childComplexity int) int
		ObjectType    func(childComplexity int) int
		SubjectID     func(childComplexity int) int
		SubjectType   func(childComplexity int) int
		UpdatedAt     func(childComplexity int) int
	}

	GrantedPermissionPage struct {
		Permissions func(childComplexity int) int
		Total       func(childComplexity int) int
	}

	Group struct {
		CreatedAt func(childComplexity int) int
		ID        func(childComplexity int) int
		Name      func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
		Users     func(childComplexity int) int
	}

	GroupMembership struct {
		Group   func(childComplexity int) int
		ID      func(childComplexity int) int
		Project func(childComplexity int) int
		Role    func(childComplexity int) int
	}

	GroupPage struct {
		Groups func(childComplexity int) int
		Total  func(childComplexity int) int
	}

	Membership struct {
		ID      func(childComplexity int) int
		Project func(childComplexity int) int
		Role    func(childComplexity int) int
		User    func(childComplexity int) int
	}

	Mutation struct {
		ConfigureProvider   func(childComplexity int, id uuid.UUID) int
		CreateBlueprint     func(childComplexity int, input model.BlueprintInput) int
		CreateGroup         func(childComplexity int, input model.GroupInput) int
		CreateProject       func(childComplexity int, input model.ProjectInput) int
		CreateProvider      func(childComplexity int, input model.ProviderInput) int
		CreateUser          func(childComplexity int, input model.UserInput) int
		DeleteBlueprint     func(childComplexity int, id uuid.UUID) int
		DeleteGroup         func(childComplexity int, id uuid.UUID) int
		DeleteProject       func(childComplexity int, id uuid.UUID) int
		DeleteProvider      func(childComplexity int, id uuid.UUID) int
		DeleteUser          func(childComplexity int, id uuid.UUID) int
		DeployBlueprint     func(childComplexity int, blueprintID uuid.UUID, projectID uuid.UUID, templateVars map[string]string) int
		DeploymentNodePower func(childComplexity int, id uuid.UUID, state provider.PowerState) int
		DeploymentPower     func(childComplexity int, id uuid.UUID, state provider.PowerState) int
		DestroyDeployment   func(childComplexity int, id uuid.UUID) int
		GrantPermission     func(childComplexity int, subjectType grantedpermission.SubjectType, subjectID uuid.UUID, objectType grantedpermission.ObjectType, objectID *uuid.UUID, action actions.PermissionAction) int
		LoadProvider        func(childComplexity int, id uuid.UUID) int
		RedeployDeployment  func(childComplexity int, id uuid.UUID, nodeIds []uuid.UUID) int
		RevokePermission    func(childComplexity int, subjectType grantedpermission.SubjectType, subjectID uuid.UUID, objectType grantedpermission.ObjectType, objectID *uuid.UUID, action actions.PermissionAction) int
		SelfChangePassword  func(childComplexity int, currentPassword string, newPassword string) int
		UnloadProvider      func(childComplexity int, id uuid.UUID) int
		UpdateBlueprint     func(childComplexity int, id uuid.UUID, input model.BlueprintInput) int
		UpdateDeployment    func(childComplexity int, id uuid.UUID, input model.DeploymentInput) int
		UpdateGroup         func(childComplexity int, id uuid.UUID, input model.GroupInput) int
		UpdateMembership    func(childComplexity int, id uuid.UUID, users []*model.MembershipInput, groups []*model.GroupMembershipInput) int
		UpdateProject       func(childComplexity int, id uuid.UUID, input model.ProjectInput) int
		UpdateProvider      func(childComplexity int, id uuid.UUID, input model.ProviderInput) int
		UpdateUser          func(childComplexity int, id uuid.UUID, input model.UserInput) int
	}

	Project struct {
		Blueprints       func(childComplexity int) int
		CreatedAt        func(childComplexity int) int
		Deployments      func(childComplexity int) int
		GroupMemberships func(childComplexity int) int
		ID               func(childComplexity int) int
		Memberships      func(childComplexity int) int
		Name             func(childComplexity int) int
		QuotaCPU         func(childComplexity int) int
		QuotaDisk        func(childComplexity int) int
		QuotaNetwork     func(childComplexity int) int
		QuotaRAM         func(childComplexity int) int
		QuotaRouter      func(childComplexity int) int
		UpdatedAt        func(childComplexity int) int
		UsageCPU         func(childComplexity int) int
		UsageDisk        func(childComplexity int) int
		UsageNetwork     func(childComplexity int) int
		UsageRAM         func(childComplexity int) int
		UsageRouter      func(childComplexity int) int
	}

	ProjectPage struct {
		Projects func(childComplexity int) int
		Total    func(childComplexity int) int
	}

	Provider struct {
		Blueprints      func(childComplexity int) int
		ConfigBytes     func(childComplexity int) int
		CreatedAt       func(childComplexity int) int
		DisplayName     func(childComplexity int) int
		ID              func(childComplexity int) int
		IsLoaded        func(childComplexity int) int
		ProviderGitURL  func(childComplexity int) int
		ProviderVersion func(childComplexity int) int
		UpdatedAt       func(childComplexity int) int
	}

	ProviderPage struct {
		Providers func(childComplexity int) int
		Total     func(childComplexity int) int
	}

	Query struct {
		Blueprint       func(childComplexity int, id uuid.UUID) int
		Blueprints      func(childComplexity int, projectFilter []uuid.UUID, count int, offset *int) int
		Deployment      func(childComplexity int, id uuid.UUID) int
		Deployments     func(childComplexity int, includeExpiredAndDestroyed bool, projectFilter []uuid.UUID, count int, offset *int) int
		Group           func(childComplexity int, id uuid.UUID) int
		Groups          func(childComplexity int, count int, offset *int) int
		Me              func(childComplexity int) int
		MeHasPermission func(childComplexity int, objectType grantedpermission.ObjectType, objectID *uuid.UUID, action actions.PermissionAction) int
		Permission      func(childComplexity int, id uuid.UUID) int
		Permissions     func(childComplexity int, count int, offset *int) int
		Project         func(childComplexity int, id uuid.UUID) int
		Projects        func(childComplexity int, count int, offset *int, minRole *membership.Role) int
		Provider        func(childComplexity int, id uuid.UUID) int
		Providers       func(childComplexity int, count int, offset *int) int
		SearchGroups    func(childComplexity int, search string, count int, offset *int) int
		SearchProjects  func(childComplexity int, search string, count int, offset *int, minRole *membership.Role) int
		SearchUsers     func(childComplexity int, search string, count int, offset *int) int
		User            func(childComplexity int, id uuid.UUID) int
		Users           func(childComplexity int, count int, offset *int) int
	}

	Resource struct {
		Blueprint         func(childComplexity int) int
		CreatedAt         func(childComplexity int) int
		DependsOn         func(childComplexity int) int
		Features          func(childComplexity int) int
		ID                func(childComplexity int) int
		Key               func(childComplexity int) int
		Object            func(childComplexity int) int
		QuotaRequirements func(childComplexity int) int
		RequiredBy        func(childComplexity int) int
		ResourceType      func(childComplexity int) int
		Type              func(childComplexity int) int
		UpdatedAt         func(childComplexity int) int
	}

	ResourceFeatures struct {
		Console func(childComplexity int) int
		Power   func(childComplexity int) int
	}

	ResourceQuotaRequirements struct {
		Cpu     func(childComplexity int) int
		Disk    func(childComplexity int) int
		Network func(childComplexity int) int
		Ram     func(childComplexity int) int
		Router  func(childComplexity int) int
	}

	User struct {
		CreatedAt   func(childComplexity int) int
		Deployments func(childComplexity int) int
		Email       func(childComplexity int) int
		FirstName   func(childComplexity int) int
		Groups      func(childComplexity int) int
		ID          func(childComplexity int) int
		LastName    func(childComplexity int) int
		UpdatedAt   func(childComplexity int) int
		Username    func(childComplexity int) int
	}

	UserPage struct {
		Total func(childComplexity int) int
		Users func(childComplexity int) int
	}
}

type Config

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

type DeploymentNodeResolver

type DeploymentNodeResolver interface {
	State(ctx context.Context, obj *ent.DeploymentNode) (model.DeploymentNodeState, error)

	Deployment(ctx context.Context, obj *ent.DeploymentNode) (*ent.Deployment, error)
	Resource(ctx context.Context, obj *ent.DeploymentNode) (*ent.Resource, error)
	NextNodes(ctx context.Context, obj *ent.DeploymentNode) ([]*ent.DeploymentNode, error)
	PrevNodes(ctx context.Context, obj *ent.DeploymentNode) ([]*ent.DeploymentNode, error)
}

type DeploymentResolver

type DeploymentResolver interface {
	State(ctx context.Context, obj *ent.Deployment) (model.DeploymentState, error)

	Blueprint(ctx context.Context, obj *ent.Deployment) (*ent.Blueprint, error)
	Project(ctx context.Context, obj *ent.Deployment) (*ent.Project, error)
	DeploymentNodes(ctx context.Context, obj *ent.Deployment) ([]*ent.DeploymentNode, error)
	Requester(ctx context.Context, obj *ent.Deployment) (*ent.User, error)
}

type DirectiveRoot

type DirectiveRoot struct {
}

type GrantedPermissionResolver

type GrantedPermissionResolver interface {
	DisplayString(ctx context.Context, obj *ent.GrantedPermission) (string, error)
}

type GroupMembershipResolver

type GroupMembershipResolver interface {
	ID(ctx context.Context, obj *ent.GroupMembership) (uuid.UUID, error)
	Project(ctx context.Context, obj *ent.GroupMembership) (*ent.Project, error)
	Group(ctx context.Context, obj *ent.GroupMembership) (*ent.Group, error)
}

type GroupResolver

type GroupResolver interface {
	Users(ctx context.Context, obj *ent.Group) ([]*ent.User, error)
}

type MembershipResolver

type MembershipResolver interface {
	ID(ctx context.Context, obj *ent.Membership) (uuid.UUID, error)
	Project(ctx context.Context, obj *ent.Membership) (*ent.Project, error)
	User(ctx context.Context, obj *ent.Membership) (*ent.User, error)
}

type MutationResolver

type MutationResolver interface {
	SelfChangePassword(ctx context.Context, currentPassword string, newPassword string) (bool, error)
	CreateUser(ctx context.Context, input model.UserInput) (*ent.User, error)
	UpdateUser(ctx context.Context, id uuid.UUID, input model.UserInput) (*ent.User, error)
	DeleteUser(ctx context.Context, id uuid.UUID) (bool, error)
	CreateGroup(ctx context.Context, input model.GroupInput) (*ent.Group, error)
	UpdateGroup(ctx context.Context, id uuid.UUID, input model.GroupInput) (*ent.Group, error)
	DeleteGroup(ctx context.Context, id uuid.UUID) (bool, error)
	GrantPermission(ctx context.Context, subjectType grantedpermission.SubjectType, subjectID uuid.UUID, objectType grantedpermission.ObjectType, objectID *uuid.UUID, action actions.PermissionAction) (*ent.GrantedPermission, error)
	RevokePermission(ctx context.Context, subjectType grantedpermission.SubjectType, subjectID uuid.UUID, objectType grantedpermission.ObjectType, objectID *uuid.UUID, action actions.PermissionAction) (bool, error)
	CreateProvider(ctx context.Context, input model.ProviderInput) (*ent.Provider, error)
	UpdateProvider(ctx context.Context, id uuid.UUID, input model.ProviderInput) (*ent.Provider, error)
	DeleteProvider(ctx context.Context, id uuid.UUID) (bool, error)
	LoadProvider(ctx context.Context, id uuid.UUID) (*ent.Provider, error)
	UnloadProvider(ctx context.Context, id uuid.UUID) (*ent.Provider, error)
	ConfigureProvider(ctx context.Context, id uuid.UUID) (*ent.Provider, error)
	CreateProject(ctx context.Context, input model.ProjectInput) (*ent.Project, error)
	UpdateProject(ctx context.Context, id uuid.UUID, input model.ProjectInput) (*ent.Project, error)
	DeleteProject(ctx context.Context, id uuid.UUID) (bool, error)
	UpdateMembership(ctx context.Context, id uuid.UUID, users []*model.MembershipInput, groups []*model.GroupMembershipInput) (*ent.Project, error)
	CreateBlueprint(ctx context.Context, input model.BlueprintInput) (*ent.Blueprint, error)
	UpdateBlueprint(ctx context.Context, id uuid.UUID, input model.BlueprintInput) (*ent.Blueprint, error)
	DeleteBlueprint(ctx context.Context, id uuid.UUID) (bool, error)
	DeployBlueprint(ctx context.Context, blueprintID uuid.UUID, projectID uuid.UUID, templateVars map[string]string) (*ent.Deployment, error)
	UpdateDeployment(ctx context.Context, id uuid.UUID, input model.DeploymentInput) (*ent.Deployment, error)
	RedeployDeployment(ctx context.Context, id uuid.UUID, nodeIds []uuid.UUID) (*ent.Deployment, error)
	DestroyDeployment(ctx context.Context, id uuid.UUID) (*ent.Deployment, error)
	DeploymentNodePower(ctx context.Context, id uuid.UUID, state provider.PowerState) (bool, error)
	DeploymentPower(ctx context.Context, id uuid.UUID, state provider.PowerState) (bool, error)
}

type ProjectResolver

type ProjectResolver interface {
	Memberships(ctx context.Context, obj *ent.Project) ([]*ent.Membership, error)
	GroupMemberships(ctx context.Context, obj *ent.Project) ([]*ent.GroupMembership, error)
	Blueprints(ctx context.Context, obj *ent.Project) ([]*ent.Blueprint, error)
	Deployments(ctx context.Context, obj *ent.Project) ([]*ent.Deployment, error)
}

type ProviderResolver

type ProviderResolver interface {
	ConfigBytes(ctx context.Context, obj *ent.Provider) (string, error)

	Blueprints(ctx context.Context, obj *ent.Provider) ([]*ent.Blueprint, error)
}

type QueryResolver

type QueryResolver interface {
	Me(ctx context.Context) (*ent.User, error)
	MeHasPermission(ctx context.Context, objectType grantedpermission.ObjectType, objectID *uuid.UUID, action actions.PermissionAction) (bool, error)
	Users(ctx context.Context, count int, offset *int) (*model.UserPage, error)
	User(ctx context.Context, id uuid.UUID) (*ent.User, error)
	Groups(ctx context.Context, count int, offset *int) (*model.GroupPage, error)
	Group(ctx context.Context, id uuid.UUID) (*ent.Group, error)
	Permissions(ctx context.Context, count int, offset *int) (*model.GrantedPermissionPage, error)
	Permission(ctx context.Context, id uuid.UUID) (*ent.GrantedPermission, error)
	Projects(ctx context.Context, count int, offset *int, minRole *membership.Role) (*model.ProjectPage, error)
	Project(ctx context.Context, id uuid.UUID) (*ent.Project, error)
	Providers(ctx context.Context, count int, offset *int) (*model.ProviderPage, error)
	Provider(ctx context.Context, id uuid.UUID) (*ent.Provider, error)
	Blueprints(ctx context.Context, projectFilter []uuid.UUID, count int, offset *int) (*model.BlueprintPage, error)
	Blueprint(ctx context.Context, id uuid.UUID) (*ent.Blueprint, error)
	Deployments(ctx context.Context, includeExpiredAndDestroyed bool, projectFilter []uuid.UUID, count int, offset *int) (*model.DeploymentPage, error)
	Deployment(ctx context.Context, id uuid.UUID) (*ent.Deployment, error)
	SearchUsers(ctx context.Context, search string, count int, offset *int) (*model.UserPage, error)
	SearchGroups(ctx context.Context, search string, count int, offset *int) (*model.GroupPage, error)
	SearchProjects(ctx context.Context, search string, count int, offset *int, minRole *membership.Role) (*model.ProjectPage, error)
}

type ResolverRoot

type ResolverRoot interface {
	Blueprint() BlueprintResolver
	Deployment() DeploymentResolver
	DeploymentNode() DeploymentNodeResolver
	GrantedPermission() GrantedPermissionResolver
	Group() GroupResolver
	GroupMembership() GroupMembershipResolver
	Membership() MembershipResolver
	Mutation() MutationResolver
	Project() ProjectResolver
	Provider() ProviderResolver
	Query() QueryResolver
	Resource() ResourceResolver
	User() UserResolver
}

type ResourceResolver

type ResourceResolver interface {
	Type(ctx context.Context, obj *ent.Resource) (model.ResourceType, error)

	Object(ctx context.Context, obj *ent.Resource) (string, error)
	Blueprint(ctx context.Context, obj *ent.Resource) (*ent.Blueprint, error)
	RequiredBy(ctx context.Context, obj *ent.Resource) ([]*ent.Resource, error)
	DependsOn(ctx context.Context, obj *ent.Resource) ([]*ent.Resource, error)
}

type UserResolver

type UserResolver interface {
	Groups(ctx context.Context, obj *ent.User) ([]*ent.Group, error)
	Deployments(ctx context.Context, obj *ent.User) ([]*ent.Deployment, error)
}

Jump to

Keyboard shortcuts

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