project

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

packae project implements used project related types in the GraphQL transport layer

packae project implements used project related types in the GraphQL transport layer

packae project implements used project related types in the GraphQL transport layer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateProjectContract

type CreateProjectContract interface {
	// MutateAndGetPayload creates a new project and returns the payload contains the result of creating a new project
	// ctx: Mandatory. Reference to the context
	// args: Mandatory. Reference to the input argument contains project information to create
	// Returns the new project payload or error if something goes wrong
	MutateAndGetPayload(
		ctx context.Context,
		args CreateProjectInputArgument) (CreateProjectPayloadResolverContract, error)
}

CreateProjectContract declares the type to use when creating a new project

type CreateProjectInput

type CreateProjectInput struct {
	Name             string
	ClientMutationId *string
}

type CreateProjectInputArgument

type CreateProjectInputArgument struct {
	Input CreateProjectInput
}

type CreateProjectPayloadResolverContract

type CreateProjectPayloadResolverContract interface {
	// Project returns the new project inforamtion
	// ctx: Mandatory. Reference to the context
	// Returns the new project inforamtion
	Project(ctx context.Context) (ProjectTypeEdgeResolverContract, error)

	// ClientMutationId returns the client mutation ID that was provided as part of the mutation request
	// ctx: Mandatory. Reference to the context
	// Returns the provided clientMutationId as part of mutation request
	ClientMutationId(ctx context.Context) *string
}

CreateProjectPayloadResolverContract declares the resolver that can return the payload contains the result of creating a new project

type DeleteProjectContract

type DeleteProjectContract interface {
	// MutateAndGetPayload update an existing project and returns the payload contains the result of deleting an existing project
	// ctx: Mandatory. Reference to the context
	// args: Mandatory. Reference to the input argument contains project information to update
	// Returns the deleted project payload or error if something goes wrong
	MutateAndGetPayload(
		ctx context.Context,
		args DeleteProjectInputArgument) (DeleteProjectPayloadResolverContract, error)
}

DeleteProjectContract declares the type to use when updating an existing project

type DeleteProjectInput

type DeleteProjectInput struct {
	ProjectID        graphql.ID
	Name             string
	ClientMutationId *string
}

type DeleteProjectInputArgument

type DeleteProjectInputArgument struct {
	Input DeleteProjectInput
}

type DeleteProjectPayloadResolverContract

type DeleteProjectPayloadResolverContract interface {
	// DeletedProjectID returns the unique identifier of the project that got deleted
	// ctx: Mandatory. Reference to the context
	// Returns the unique identifier of the the project that got deleted
	DeletedProjectID(ctx context.Context) graphql.ID

	// ClientMutationId returns the client mutation ID that was provided as part of the mutation request
	// ctx: Mandatory. Reference to the context
	// Returns the provided clientMutationId as part of mutation request
	ClientMutationId(ctx context.Context) *string
}

DeleteProjectPayloadResolverContract declares the resolver that can return the payload contains the result of deleting an existing project

type MutationResolverCreatorContract

type MutationResolverCreatorContract interface {
	// NewCreateProject creates new instance of the CreateProjectContract, setting up all dependencies and returns the instance
	// ctx: Mandatory. Reference to the context
	// Returns the new instance or error if something goes wrong
	NewCreateProject(ctx context.Context) (CreateProjectContract, error)

	// NewCreateProjectPayloadResolver creates new instance of the CreateProjectPayloadResolverContract, setting up all dependencies and returns the instance
	// ctx: Mandatory. Reference to the context
	// clientMutationId: Optional. Reference to the client mutation ID to correlate the request and response
	// projectID: Mandatory. The project unique identifier
	// projectDetail: Mandatory. The project details
	// cursor: Mandatory. The edge cluster cursor
	// Returns the new instance or error if something goes wrong
	NewCreateProjectPayloadResolver(
		ctx context.Context,
		clientMutationId *string,
		projectID string,
		projectDetail *ProjectDetail,
		cursor string) (CreateProjectPayloadResolverContract, error)

	// NewUpdateProject creates new instance of the UpdateProjectContract, setting up all dependencies and returns the instance
	// ctx: Mandatory. Reference to the context
	// clientMutationId: Optional. Reference to the client mutation ID to correlate the request and response
	// Returns the new instance or error if something goes wrong
	NewUpdateProject(ctx context.Context) (UpdateProjectContract, error)

	// NewUpdateProjectPayloadResolver creates new instance of the UpdateProjectPayloadResolverContract, setting up all dependencies and returns the instance
	// ctx: Mandatory. Reference to the context
	// clientMutationId: Optional. Reference to the client mutation ID to correlate the request and response
	// projectID: Mandatory. The project unique identifier
	// projectDetail: Mandatory. The project details
	// cursor: Mandatory. The edge cluster cursor
	// Returns the new instance or error if something goes wrong
	NewUpdateProjectPayloadResolver(
		ctx context.Context,
		clientMutationId *string,
		projectID string,
		projectDetail *ProjectDetail,
		cursor string) (UpdateProjectPayloadResolverContract, error)

	// NewDeleteProject creates new instance of the DeleteProjectContract, setting up all dependencies and returns the instance
	// ctx: Mandatory. Reference to the context
	// clientMutationId: Optional. Reference to the client mutation ID to correlate the request and response
	// Returns the new instance or error if something goes wrong
	NewDeleteProject(ctx context.Context) (DeleteProjectContract, error)

	// NewDeleteProjectPayloadResolver creates new instance of the DeleteProjectPayloadResolverContract, setting up all dependencies and returns the instance
	// ctx: Mandatory. Reference to the context
	// projectID: Mandatory. The project unique identifier
	// clientMutationId: Optional. Reference to the client mutation ID to correlate the request and response
	// Returns the new instance or error if something goes wrong
	NewDeleteProjectPayloadResolver(
		ctx context.Context,
		projectID string,
		clientMutationId *string) (DeleteProjectPayloadResolverContract, error)
}

type ProjectClientContract

type ProjectClientContract interface {
	// CreateClient creats a new project gRPC client and returns the connection
	// and the client to the caller.
	// Returns connection and the project gRPC client or error if something goes wrong.
	CreateClient() (*grpc.ClientConn, projectGrpcContract.ServiceClient, error)
}

ProjectClientContract wraps the tennat gRPC client to make it easy for testing

type ProjectClusterEdgeClusterInputArgument

type ProjectClusterEdgeClusterInputArgument struct {
	EdgeClusterID graphql.ID
}

type ProjectDetail

type ProjectDetail struct {
	Project *projectGrpcContract.Project
}

type ProjectEdgeClustersInputArgument

type ProjectEdgeClustersInputArgument struct {
	relay.ConnectionArgument
	EdgeClusterIDs *[]graphql.ID
	SortOption     *string
}

type ProjectResolverContract

type ProjectResolverContract interface {
	// ID returns project unique identifier
	// ctx: Mandatory. Reference to the context
	// Returns the project unique identifier
	ID(ctx context.Context) graphql.ID

	// Name returns project name
	// ctx: Mandatory. Reference to the context
	// Returns the project name
	Name(ctx context.Context) string

	// EdgeCluster returns project resolver
	// ctx: Mandatory. Reference to the context
	// args: Mandatory. The argument list
	// Returns the project resolver or error if something goes wrong
	EdgeCluster(
		ctx context.Context,
		args ProjectClusterEdgeClusterInputArgument) (edgecluster.EdgeClusterResolverContract, error)

	// EdgeClusters returns project connection compatible with graphql-relay
	// ctx: Mandatory. Reference to the context
	// args: Mandatory. The argument list
	// Returns the project resolver or error if something goes wrong
	EdgeClusters(
		ctx context.Context,
		args ProjectEdgeClustersInputArgument) (edgecluster.EdgeClusterTypeConnectionResolverContract, error)
}

ProjectResolverContract declares the resolver that can retrieve project information

type ProjectTypeConnectionResolverContract

type ProjectTypeConnectionResolverContract interface {
	// PageInfo returns the paging information compatible with graphql-relay
	// ctx: Mandatory. Reference to the context
	// Returns the paging information
	PageInfo(ctx context.Context) (relay.PageInfoResolverContract, error)

	// Edges returns the project edges compatible with graphql-relay
	// ctx: Mandatory. Reference to the context
	// Returns the project edges
	Edges(ctx context.Context) (*[]ProjectTypeEdgeResolverContract, error)

	// TotalCount returns total count of the matched projects
	// ctx: Mandatory. Reference to the context
	// Returns the total count of the matched projects
	TotalCount(ctx context.Context) *int32
}

ProjectTypeConnectionResolverContract declares the resolver that returns project edge compatible with graphql-relay

type ProjectTypeEdgeResolverContract

type ProjectTypeEdgeResolverContract interface {
	// Node returns the project resolver
	// ctx: Mandatory. Reference to the context
	// Returns the project resolver or error if something goes wrong
	Node(ctx context.Context) (ProjectResolverContract, error)

	// Cursor returns the cursor for the project edge compatible with graphql-relay
	// ctx: Mandatory. Reference to the context
	// Returns the cursor
	Cursor(ctx context.Context) string
}

ProjectTypeEdgeResolverContract declares the resolver that returns project edge compatible with graphql-relay

type QueryResolverCreatorContract

type QueryResolverCreatorContract interface {
	// NewProjectResolver creates new ProjectResolverContract and returns it
	// ctx: Mandatory. Reference to the context
	// projectID: Mandatory. The project unique identifier
	// projectDetail: Optional. The tennat details, if provided, the value be used instead of contacting  the edge cluster service
	// Returns the ProjectResolverContract or error if something goes wrong
	NewProjectResolver(
		ctx context.Context,
		projectID string,
		projectDetail *ProjectDetail) (ProjectResolverContract, error)

	// NewProjectTypeEdgeResolver creates new ProjectTypeEdgeResolverContract and returns it
	// ctx: Mandatory. Reference to the context
	// projectID: Mandatory. The project unique identifier
	// projectDetail: Optional. The tennat details, if provided, the value be used instead of contacting  the edge cluster service
	// cursor: Mandatory. The cursor
	// Returns the ProjectTypeEdgeResolverContract or error if something goes wrong
	NewProjectTypeEdgeResolver(
		ctx context.Context,
		projectID string,
		cursor string,
		projectDetail *ProjectDetail) (ProjectTypeEdgeResolverContract, error)

	// NewProjectTypeConnectionResolver creates new ProjectTypeConnectionResolverContract and returns it
	// ctx: Mandatory. Reference to the context
	// projects: Mandatory. Reference the list of projects
	// hasPreviousPage: Mandatory. Indicates whether more edges exist prior to the set defined by the clients arguments
	// hasNextPage: Mandatory. Indicates whether more edges exist following the set defined by the clients arguments
	// totalCount: Mandatory. The total count of matched projects
	// Returns the ProjectTypeConnectionResolverContract or error if something goes wrong
	NewProjectTypeConnectionResolver(
		ctx context.Context,
		projects []*projectGrpcContract.ProjectWithCursor,
		hasPreviousPage bool,
		hasNextPage bool,
		totalCount int32) (ProjectTypeConnectionResolverContract, error)
}

type RootResolverContract

type RootResolverContract interface {
	// CreateProject returns create project mutator
	// ctx: Mandatory. Reference to the context
	// Returns the create project mutator or error if something goes wrong
	CreateProject(
		ctx context.Context,
		args CreateProjectInputArgument) (CreateProjectPayloadResolverContract, error)

	// UpdateProject returns update project mutator
	// ctx: Mandatory. Reference to the context
	// Returns the update project mutator or error if something goes wrong
	UpdateProject(
		ctx context.Context,
		args UpdateProjectInputArgument) (UpdateProjectPayloadResolverContract, error)

	// DeleteProject returns delete project mutator
	// ctx: Mandatory. Reference to the context
	// Returns the delete project mutator or error if something goes wrong
	DeleteProject(
		ctx context.Context,
		args DeleteProjectInputArgument) (DeleteProjectPayloadResolverContract, error)
}

RootResolverContract declares the root resolver

type UpdateProjectContract

type UpdateProjectContract interface {
	// MutateAndGetPayload update an existing project and returns the payload contains the result of updating an existing project
	// ctx: Mandatory. Reference to the context
	// args: Mandatory. Reference to the input argument contains project information to update
	// Returns the updated project payload or error if something goes wrong
	MutateAndGetPayload(
		ctx context.Context,
		args UpdateProjectInputArgument) (UpdateProjectPayloadResolverContract, error)
}

UpdateProjectContract declares the type to use when updating an existing project

type UpdateProjectInput

type UpdateProjectInput struct {
	ProjectID        graphql.ID
	Name             string
	ClientMutationId *string
}

type UpdateProjectInputArgument

type UpdateProjectInputArgument struct {
	Input UpdateProjectInput
}

type UpdateProjectPayloadResolverContract

type UpdateProjectPayloadResolverContract interface {
	// Project returns the updated project inforamtion
	// ctx: Mandatory. Reference to the context
	// Returns the updated project inforamtion
	Project(ctx context.Context) (ProjectTypeEdgeResolverContract, error)

	// ClientMutationId returns the client mutation ID that was provided as part of the mutation request
	// ctx: Mandatory. Reference to the context
	// Returns the provided clientMutationId as part of mutation request
	ClientMutationId(ctx context.Context) *string
}

UpdateProjectPayloadResolverContract declares the resolver that can return the payload contains the result of updating an existing project

Jump to

Keyboard shortcuts

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