Documentation ¶
Index ¶
- Variables
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func NewHandler(s *services.Service) http.Handler
- func NewPlaygroundHandler(endpoint string) http.Handler
- type ComplexityRoot
- type Config
- type Configuration
- type Credential
- type Deployment
- type DeploymentState
- type DirectiveRoot
- type Instance
- type MutationResolver
- type NewDeployment
- type NewDeployments
- type NewPluginConfiguration
- type NewService
- type NewServiceConfiguration
- type NewUseCaseConfiguration
- type PluginConfiguration
- type QueryResolver
- type Resolver
- type ResolverRoot
- type ServiceConfiguration
- type ServiceType
- type UpdateServiceConfiguration
- type UpdateUseCaseConfiguration
- type UseCaseConfiguration
Constants ¶
This section is empty.
Variables ¶
View Source
var AllDeploymentState = []DeploymentState{ DeploymentStateRunning, DeploymentStatePending, DeploymentStateStopped, }
View Source
var AllServiceType = []ServiceType{ ServiceTypeSonarqube, ServiceTypeJenkins, }
Functions ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func NewPlaygroundHandler ¶
Types ¶
type ComplexityRoot ¶
type ComplexityRoot struct { Configuration struct { Usecases func(childComplexity int) int } Credential struct { Password func(childComplexity int) int Username func(childComplexity int) int } Deployment struct { CallbackURL func(childComplexity int) int Canonical func(childComplexity int) int Instances func(childComplexity int) int Type func(childComplexity int) int } Instance struct { State func(childComplexity int) int URL func(childComplexity int) int UserCredential func(childComplexity int) int } Mutation struct { AddServiceConfiguration func(childComplexity int, uc string, input NewServiceConfiguration) int AddUseCaseConfiguration func(childComplexity int, input NewUseCaseConfiguration) int CreateDeployments func(childComplexity int, input NewDeployments) int DeleteDeployment func(childComplexity int, canonical string) int DeleteServiceConfiguration func(childComplexity int, uc string, service *ServiceType) int DeleteUseCaseConfiguration func(childComplexity int, uc string) int UpdateServiceConfiguration func(childComplexity int, uc string, service ServiceType, input UpdateServiceConfiguration) int UpdateUseCaseConfiguration func(childComplexity int, uc string, input UpdateUseCaseConfiguration) int } PluginConfiguration struct { Name func(childComplexity int) int Version func(childComplexity int) int } Query struct { Configuration func(childComplexity int) int Deployments func(childComplexity int) int FindDeployment func(childComplexity int, canonical string) int FindServiceConfiguration func(childComplexity int, uc string, service string) int FindUseCaseConfiguration func(childComplexity int, name string) int } ServiceConfiguration struct { Plugins func(childComplexity int) int Type func(childComplexity int) int Version func(childComplexity int) int } UseCaseConfiguration struct { Name func(childComplexity int) int Services func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type Configuration ¶
type Configuration struct {
Usecases []UseCaseConfiguration `json:"usecases"`
}
type Credential ¶
type Deployment ¶
type DeploymentState ¶
type DeploymentState string
const ( DeploymentStateRunning DeploymentState = "running" DeploymentStatePending DeploymentState = "pending" DeploymentStateStopped DeploymentState = "stopped" )
func (DeploymentState) IsValid ¶
func (e DeploymentState) IsValid() bool
func (DeploymentState) MarshalGQL ¶
func (e DeploymentState) MarshalGQL(w io.Writer)
func (DeploymentState) String ¶
func (e DeploymentState) String() string
func (*DeploymentState) UnmarshalGQL ¶
func (e *DeploymentState) UnmarshalGQL(v interface{}) error
type DirectiveRoot ¶
type DirectiveRoot struct { }
type Instance ¶
type Instance struct { URL string `json:"url"` State DeploymentState `json:"state"` UserCredential *Credential `json:"userCredential"` }
type MutationResolver ¶
type MutationResolver interface { AddUseCaseConfiguration(ctx context.Context, input NewUseCaseConfiguration) (*Configuration, error) UpdateUseCaseConfiguration(ctx context.Context, uc string, input UpdateUseCaseConfiguration) (*Configuration, error) DeleteUseCaseConfiguration(ctx context.Context, uc string) (*Configuration, error) AddServiceConfiguration(ctx context.Context, uc string, input NewServiceConfiguration) (*Configuration, error) UpdateServiceConfiguration(ctx context.Context, uc string, service ServiceType, input UpdateServiceConfiguration) (*Configuration, error) DeleteServiceConfiguration(ctx context.Context, uc string, service *ServiceType) (*Configuration, error) CreateDeployments(ctx context.Context, input NewDeployments) ([]Deployment, error) DeleteDeployment(ctx context.Context, canonical string) ([]Deployment, error) }
type NewDeployment ¶
type NewDeployment struct { Usecase string `json:"usecase"` Services []NewService `json:"services"` }
type NewDeployments ¶
type NewDeployments struct { Deployments []NewDeployment `json:"deployments"` CallbackURL string `json:"callbackURL"` }
type NewPluginConfiguration ¶
type NewService ¶
type NewService struct { Service ServiceType `json:"service"` Count *int `json:"count"` }
type NewServiceConfiguration ¶
type NewServiceConfiguration struct { Type ServiceType `json:"type"` Version *string `json:"version"` Plugins []NewPluginConfiguration `json:"plugins"` }
type NewUseCaseConfiguration ¶
type NewUseCaseConfiguration struct { Name string `json:"name"` Services []NewServiceConfiguration `json:"services"` }
type PluginConfiguration ¶
type QueryResolver ¶
type QueryResolver interface { Configuration(ctx context.Context) (*Configuration, error) FindUseCaseConfiguration(ctx context.Context, name string) (*UseCaseConfiguration, error) FindServiceConfiguration(ctx context.Context, uc string, service string) (*ServiceConfiguration, error) Deployments(ctx context.Context) ([]Deployment, error) FindDeployment(ctx context.Context, canonical string) (*Deployment, error) }
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
Mutation returns MutationResolver implementation.
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
Query returns QueryResolver implementation.
type ResolverRoot ¶
type ResolverRoot interface { Mutation() MutationResolver Query() QueryResolver }
type ServiceConfiguration ¶
type ServiceConfiguration struct { Type ServiceType `json:"type"` Version *string `json:"version"` Plugins []PluginConfiguration `json:"plugins"` }
type ServiceType ¶
type ServiceType string
const ( ServiceTypeSonarqube ServiceType = "sonarqube" ServiceTypeJenkins ServiceType = "jenkins" )
func (ServiceType) IsValid ¶
func (e ServiceType) IsValid() bool
func (ServiceType) MarshalGQL ¶
func (e ServiceType) MarshalGQL(w io.Writer)
func (ServiceType) String ¶
func (e ServiceType) String() string
func (*ServiceType) UnmarshalGQL ¶
func (e *ServiceType) UnmarshalGQL(v interface{}) error
type UpdateServiceConfiguration ¶
type UpdateServiceConfiguration struct { Version *string `json:"version"` Plugins []NewPluginConfiguration `json:"plugins"` }
type UpdateUseCaseConfiguration ¶
type UpdateUseCaseConfiguration struct {
Services []NewServiceConfiguration `json:"services"`
}
type UseCaseConfiguration ¶
type UseCaseConfiguration struct { Name string `json:"name"` Services []ServiceConfiguration `json:"services"` }
Click to show internal directories.
Click to hide internal directories.