Documentation ¶
Index ¶
- Variables
- func GinContextFrom(ctx context.Context) *gin.Context
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func WithInGinCtx() gin.HandlerFunc
- type ComplexityRoot
- type Config
- type CreateTask
- type DeleteTask
- type DirectiveRoot
- type MutationResolver
- type Pair
- type PairInput
- type QueryResolver
- type Resolver
- type ResolverRoot
- type Server
- type Staff
- type StaffInput
- type Storage
- type StorageInput
- type StorageType
- type Task
- type TaskStatus
- type TaskType
Constants ¶
This section is empty.
Variables ¶
View Source
var AllStorageType = []StorageType{ StorageTypeFs, StorageTypeQingstor, }
View Source
var AllTaskStatus = []TaskStatus{ TaskStatusCreated, TaskStatusReady, TaskStatusRunning, TaskStatusFinished, TaskStatusStopped, TaskStatusError, }
View Source
var AllTaskType = []TaskType{ TaskTypeCopyDir, }
Functions ¶
func GinContextFrom ¶
GinContextFrom retrieve gin.Context from request's context inspired from https://gqlgen.com/recipes/gin/#accessing-gincontext
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func WithInGinCtx ¶
func WithInGinCtx() gin.HandlerFunc
WithInGinCtx set gin context into request's context with key ginCtxKey inspired from https://gqlgen.com/recipes/gin/#accessing-gincontext
Types ¶
type ComplexityRoot ¶
type ComplexityRoot struct { Mutation struct { CreateTask func(childComplexity int, input *CreateTask) int DeleteTask func(childComplexity int, input *DeleteTask) int RunTask func(childComplexity int, id string) int } Pair struct { Key func(childComplexity int) int Value func(childComplexity int) int } Query struct { Task func(childComplexity int, id string) int Tasks func(childComplexity int) int } Staff struct { ID func(childComplexity int) int } Storage struct { Options func(childComplexity int) int Type func(childComplexity int) int } Task struct { CreatedAt func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int Options func(childComplexity int) int Staffs func(childComplexity int) int Status func(childComplexity int) int Storages func(childComplexity int) int Type func(childComplexity int) int UpdatedAt func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type CreateTask ¶
type CreateTask struct { Name string `json:"name"` Type TaskType `json:"type"` Storages []*StorageInput `json:"storages"` Options []*PairInput `json:"options"` Staffs []*StaffInput `json:"staffs"` }
type DeleteTask ¶
type DeleteTask struct {
ID string `json:"id"`
}
type DirectiveRoot ¶
type DirectiveRoot struct { }
type MutationResolver ¶
type QueryResolver ¶
type Resolver ¶
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 Server ¶
func (*Server) RegisterRouter ¶
type StaffInput ¶ added in v0.2.0
type StaffInput struct {
ID string `json:"id"`
}
type Storage ¶ added in v0.2.0
type Storage struct { Type StorageType `json:"type"` Options []*Pair `json:"options"` }
type StorageInput ¶ added in v0.2.0
type StorageInput struct { Type StorageType `json:"type"` Options []*PairInput `json:"options"` }
type StorageType ¶ added in v0.2.0
type StorageType string
const ( StorageTypeFs StorageType = "Fs" StorageTypeQingstor StorageType = "Qingstor" )
func (StorageType) IsValid ¶ added in v0.2.0
func (e StorageType) IsValid() bool
func (StorageType) MarshalGQL ¶ added in v0.2.0
func (e StorageType) MarshalGQL(w io.Writer)
func (StorageType) String ¶ added in v0.2.0
func (e StorageType) String() string
func (*StorageType) UnmarshalGQL ¶ added in v0.2.0
func (e *StorageType) UnmarshalGQL(v interface{}) error
type Task ¶ added in v0.2.0
type Task struct { ID string `json:"id"` Name string `json:"name"` Type TaskType `json:"type"` Status TaskStatus `json:"status"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Storages []*Storage `json:"storages"` Options []*Pair `json:"options"` Staffs []*Staff `json:"staffs"` }
type TaskStatus ¶ added in v0.2.0
type TaskStatus string
const ( TaskStatusCreated TaskStatus = "Created" TaskStatusReady TaskStatus = "Ready" TaskStatusRunning TaskStatus = "Running" TaskStatusFinished TaskStatus = "Finished" TaskStatusStopped TaskStatus = "Stopped" TaskStatusError TaskStatus = "Error" )
func (TaskStatus) IsValid ¶ added in v0.2.0
func (e TaskStatus) IsValid() bool
func (TaskStatus) MarshalGQL ¶ added in v0.2.0
func (e TaskStatus) MarshalGQL(w io.Writer)
func (TaskStatus) String ¶ added in v0.2.0
func (e TaskStatus) String() string
func (*TaskStatus) UnmarshalGQL ¶ added in v0.2.0
func (e *TaskStatus) UnmarshalGQL(v interface{}) error
type TaskType ¶ added in v0.2.0
type TaskType string
const (
TaskTypeCopyDir TaskType = "copyDir"
)
func (TaskType) MarshalGQL ¶ added in v0.2.0
func (*TaskType) UnmarshalGQL ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.