generated

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 14 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 AssignmentResolver

type AssignmentResolver interface {
	Role(ctx context.Context, obj *models.Assignment) (*models.Role, error)
	User(ctx context.Context, obj *models.Assignment) (*models.User, error)
}

type ComplexityRoot

type ComplexityRoot struct {
	Assignment struct {
		CreatedAt func(childComplexity int) int
		ID        func(childComplexity int) int
		Role      func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
		User      func(childComplexity int) int
	}

	AuditEvent struct {
		EventName   func(childComplexity int) int
		TargetID    func(childComplexity int) int
		TargetLabel func(childComplexity int) int
		TargetType  func(childComplexity int) int
		Time        func(childComplexity int) int
		UserEmail   func(childComplexity int) int
		UserID      func(childComplexity int) int
		UserName    func(childComplexity int) int
	}

	Contributor struct {
		CreatedAt func(childComplexity int) int
		ID        func(childComplexity int) int
		Project   func(childComplexity int) int
		Role      func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
		User      func(childComplexity int) int
	}

	CreateTokenResponse struct {
		Secret func(childComplexity int) int
		Token  func(childComplexity int) int
	}

	CreateUserResponse struct {
		Password func(childComplexity int) int
		User     func(childComplexity int) int
	}

	Mutation struct {
		ApproveSuggestion       func(childComplexity int, id string) int
		ArchiveProject          func(childComplexity int, id *string, label *models.Label) int
		AttemptRecovery         func(childComplexity int, input model.AttemptRecoveryRequest) int
		CreateProject           func(childComplexity int, project model.CreateProjectRequest) int
		CreateRecovery          func(childComplexity int, input model.CreateRecoveryRequest) int
		CreateToken             func(childComplexity int, input model.CreateTokenRequest) int
		CreateUser              func(childComplexity int, input model.CreateUserRequest) int
		GetProjectSuggestion    func(childComplexity int, id string) int
		GetProjectSuggestions   func(childComplexity int, label models.Label) int
		ListSuggestions         func(childComplexity int) int
		RejectProjectSuggestion func(childComplexity int, id string) int
		RemoveContributor       func(childComplexity int, projectLabel models.Label, userEmail models.Email) int
		RemoveToken             func(childComplexity int, id string) int
		SetOrgRole              func(childComplexity int, userEmail models.Email, roleLabel models.Label) int
		SetProjectRole          func(childComplexity int, userEmail models.Email, projectLabel models.Label, roleLabel models.Label) int
		SuggestPolicy           func(childComplexity int, name string, description string, request model.ProjectSpecFile) int
		SuggestProjectPolicy    func(childComplexity int, label models.Label, name string, description string, request model.ProjectSpecFile) int
		UnarchiveProject        func(childComplexity int, id *string, label *models.Label) int
		UpdateContributor       func(childComplexity int, projectLabel models.Label, userEmail models.Email, roleLabel models.Label) int
		UpdateProject           func(childComplexity int, id *string, label *models.Label, update model.UpdateProjectRequest) int
		UpdateProjectSpec       func(childComplexity int, id *string, label *models.Label, request model.ProjectSpecFile) int
	}

	Policy struct {
		CreatedAt       func(childComplexity int) int
		ID              func(childComplexity int) int
		Parent          func(childComplexity int) int
		Project         func(childComplexity int) int
		Rules           func(childComplexity int) int
		Transformations func(childComplexity int) int
		UpdatedAt       func(childComplexity int) int
	}

	Project struct {
		Contributors func(childComplexity int) int
		CreatedAt    func(childComplexity int) int
		CurrentSpec  func(childComplexity int) int
		Description  func(childComplexity int) int
		ID           func(childComplexity int) int
		Label        func(childComplexity int) int
		Name         func(childComplexity int) int
		Status       func(childComplexity int) int
		UpdatedAt    func(childComplexity int) int
	}

	Query struct {
		GetAuditLog      func(childComplexity int, opts *model.AuditLogQueryOptions) int
		ListContributors func(childComplexity int, projectLabel models.Label) int
		Me               func(childComplexity int) int
		MyRole           func(childComplexity int, projectLabel *models.Label) int
		OrgPolicy        func(childComplexity int) int
		Project          func(childComplexity int, id *string, label *models.Label) int
		Projects         func(childComplexity int, status models.ProjectStatus) int
		Tokens           func(childComplexity int, userID string) int
		User             func(childComplexity int, id string) int
		Users            func(childComplexity int) int
	}

	Recovery struct {
		CreatedAt func(childComplexity int) int
		ID        func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
	}

	Role struct {
		CreatedAt func(childComplexity int) int
		ID        func(childComplexity int) int
		Label     func(childComplexity int) int
		System    func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
	}

	Suggestion struct {
		CreatedAt   func(childComplexity int) int
		Description func(childComplexity int) int
		ID          func(childComplexity int) int
		Policy      func(childComplexity int) int
		Project     func(childComplexity int) int
		State       func(childComplexity int) int
		Title       func(childComplexity int) int
		UpdatedAt   func(childComplexity int) int
	}

	Token struct {
		ID     func(childComplexity int) int
		UserID func(childComplexity int) int
	}

	User struct {
		CreatedAt func(childComplexity int) int
		Email     func(childComplexity int) int
		ID        func(childComplexity int) int
		Name      func(childComplexity int) int
		Role      func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type ContributorResolver

type ContributorResolver interface {
	User(ctx context.Context, obj *models.Contributor) (*models.User, error)
	Project(ctx context.Context, obj *models.Contributor) (*models.Project, error)
	Role(ctx context.Context, obj *models.Contributor) (*models.Role, error)
}

type DirectiveRoot

type DirectiveRoot struct {
}

type MutationResolver

type MutationResolver interface {
	SuggestPolicy(ctx context.Context, name string, description string, request model.ProjectSpecFile) (*models.Suggestion, error)
	ListSuggestions(ctx context.Context) ([]*models.Suggestion, error)
	ApproveSuggestion(ctx context.Context, id string) (*models.Suggestion, error)
	CreateProject(ctx context.Context, project model.CreateProjectRequest) (*models.Project, error)
	UpdateProject(ctx context.Context, id *string, label *models.Label, update model.UpdateProjectRequest) (*models.Project, error)
	UpdateProjectSpec(ctx context.Context, id *string, label *models.Label, request model.ProjectSpecFile) (*models.Project, error)
	SuggestProjectPolicy(ctx context.Context, label models.Label, name string, description string, request model.ProjectSpecFile) (*models.Suggestion, error)
	GetProjectSuggestions(ctx context.Context, label models.Label) ([]*models.Suggestion, error)
	RejectProjectSuggestion(ctx context.Context, id string) (*models.Project, error)
	GetProjectSuggestion(ctx context.Context, id string) (*models.Suggestion, error)
	ArchiveProject(ctx context.Context, id *string, label *models.Label) (*models.Project, error)
	UnarchiveProject(ctx context.Context, id *string, label *models.Label) (*models.Project, error)
	UpdateContributor(ctx context.Context, projectLabel models.Label, userEmail models.Email, roleLabel models.Label) (*models.Contributor, error)
	RemoveContributor(ctx context.Context, projectLabel models.Label, userEmail models.Email) (*models.Contributor, error)
	CreateRecovery(ctx context.Context, input model.CreateRecoveryRequest) (*string, error)
	AttemptRecovery(ctx context.Context, input model.AttemptRecoveryRequest) (*string, error)
	SetOrgRole(ctx context.Context, userEmail models.Email, roleLabel models.Label) (*models.Assignment, error)
	SetProjectRole(ctx context.Context, userEmail models.Email, projectLabel models.Label, roleLabel models.Label) (*models.Assignment, error)
	CreateToken(ctx context.Context, input model.CreateTokenRequest) (*model.CreateTokenResponse, error)
	RemoveToken(ctx context.Context, id string) (string, error)
	CreateUser(ctx context.Context, input model.CreateUserRequest) (*model.CreateUserResponse, error)
}

type PolicyResolver

type PolicyResolver interface {
	Project(ctx context.Context, obj *models.Policy) (*models.Project, error)
	Parent(ctx context.Context, obj *models.Policy) (*models.Policy, error)
}

type ProjectResolver

type ProjectResolver interface {
	CurrentSpec(ctx context.Context, obj *models.Project) (*models.Policy, error)
	Contributors(ctx context.Context, obj *models.Project) ([]*models.Contributor, error)
}

type QueryResolver

type QueryResolver interface {
	Me(ctx context.Context) (*models.User, error)
	GetAuditLog(ctx context.Context, opts *model.AuditLogQueryOptions) ([]*models1.Event, error)
	OrgPolicy(ctx context.Context) (*models.Policy, error)
	Projects(ctx context.Context, status models.ProjectStatus) ([]*models.Project, error)
	Project(ctx context.Context, id *string, label *models.Label) (*models.Project, error)
	ListContributors(ctx context.Context, projectLabel models.Label) ([]*models.Contributor, error)
	MyRole(ctx context.Context, projectLabel *models.Label) (*models.Role, error)
	Tokens(ctx context.Context, userID string) ([]string, error)
	User(ctx context.Context, id string) (*models.User, error)
	Users(ctx context.Context) ([]*models.User, error)
}

type ResolverRoot

type ResolverRoot interface {
	Assignment() AssignmentResolver
	Contributor() ContributorResolver
	Mutation() MutationResolver
	Policy() PolicyResolver
	Project() ProjectResolver
	Query() QueryResolver
	Suggestion() SuggestionResolver
	User() UserResolver
}

type SuggestionResolver

type SuggestionResolver interface {
	Project(ctx context.Context, obj *models.Suggestion) (*models.Project, error)
	Policy(ctx context.Context, obj *models.Suggestion) (*models.Policy, error)
}

type UserResolver

type UserResolver interface {
	Role(ctx context.Context, obj *models.User) (*models.Role, error)
}

Jump to

Keyboard shortcuts

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