Documentation
¶
Index ¶
- Constants
- Variables
- func AddMutationEvent(ctx context.Context, e events.Event)
- func ApplyChanges(changes map[string]interface{}, to interface{}) error
- func DeleteAllExportsHandler(ctx context.Context, r *GeneratedResolver) (bool, error)
- func EnrichContextWithMutations(ctx context.Context, r *GeneratedResolver) context.Context
- func FinishMutationContext(ctx context.Context, r *GeneratedResolver) (err error)
- func GetHTTPServeMux(r ResolverRoot, db *DB) *http.ServeMux
- func GetItem(ctx context.Context, db *gorm.DB, out interface{}, id *string) error
- func GetItemForRelation(ctx context.Context, db *gorm.DB, obj interface{}, relation string, ...) error
- func GetLoaders(db *DB) map[string]*dataloader.Loader
- func GetPrincipalIDFromContext(ctx context.Context) *string
- func GetTransaction(ctx context.Context) *gorm.DB
- func Marshal_Any(v interface{}) graphql.Marshaler
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func TableName(name string) string
- func Unmarshal_Any(v interface{}) (interface{}, error)
- type ComplexityRoot
- type Config
- type DB
- type DirectiveRoot
- type EntityFilter
- type EntityFilterQuery
- type EntityResultType
- type EntitySort
- type Export
- func CreateExportHandler(ctx context.Context, r *GeneratedResolver, input map[string]interface{}) (item *Export, err error)
- func DeleteExportHandler(ctx context.Context, r *GeneratedResolver, id string) (item *Export, err error)
- func QueryExportHandler(ctx context.Context, r *GeneratedResolver, opts QueryExportHandlerOptions) (*Export, error)
- func UpdateExportHandler(ctx context.Context, r *GeneratedResolver, id string, ...) (item *Export, err error)
- type ExportChanges
- type ExportFilterType
- func (f *ExportFilterType) AndWith(f2 ...*ExportFilterType) *ExportFilterType
- func (f *ExportFilterType) Apply(ctx context.Context, dialect gorm.Dialect, wheres *[]string, ...) error
- func (f *ExportFilterType) ApplyWithAlias(ctx context.Context, dialect gorm.Dialect, alias string, wheres *[]string, ...) error
- func (f *ExportFilterType) IsEmpty(ctx context.Context, dialect gorm.Dialect) bool
- func (f *ExportFilterType) OrWith(f2 ...*ExportFilterType) *ExportFilterType
- func (f *ExportFilterType) WhereContent(dialect gorm.Dialect, aliasPrefix string) (conditions []string, values []interface{})
- type ExportQueryFilter
- type ExportResolver
- type ExportResultType
- type ExportResultTypeResolver
- type ExportSortType
- type ExportState
- type File
- type GeneratedExportResolver
- type GeneratedExportResultTypeResolver
- type GeneratedFileResolver
- type GeneratedMutationResolver
- func (r *GeneratedMutationResolver) CreateExport(ctx context.Context, input map[string]interface{}) (item *Export, err error)
- func (r *GeneratedMutationResolver) DeleteAllExports(ctx context.Context) (bool, error)
- func (r *GeneratedMutationResolver) DeleteExport(ctx context.Context, id string) (item *Export, err error)
- func (r *GeneratedMutationResolver) UpdateExport(ctx context.Context, id string, input map[string]interface{}) (item *Export, err error)
- type GeneratedQueryResolver
- type GeneratedResolver
- type GetItemsOptions
- type JWTClaims
- type MutationEvents
- type MutationResolver
- type NotFoundError
- type ObjectSortType
- type QueryExportHandlerOptions
- type QueryExportsHandlerOptions
- type QueryResolver
- type ResolutionHandlers
- type ResolverRoot
Constants ¶
Variables ¶
View Source
var AllExportState = []ExportState{ ExportStateProcessing, ExportStateCompleted, ExportStateError, }
View Source
var AllObjectSortType = []ObjectSortType{ ObjectSortTypeAsc, ObjectSortTypeDesc, }
Functions ¶
func ApplyChanges ¶
used to convert map[string]interface{} to EntityChanges struct
func DeleteAllExportsHandler ¶
func DeleteAllExportsHandler(ctx context.Context, r *GeneratedResolver) (bool, error)
func EnrichContextWithMutations ¶
func EnrichContextWithMutations(ctx context.Context, r *GeneratedResolver) context.Context
func FinishMutationContext ¶
func FinishMutationContext(ctx context.Context, r *GeneratedResolver) (err error)
func GetHTTPServeMux ¶
func GetHTTPServeMux(r ResolverRoot, db *DB) *http.ServeMux
func GetItemForRelation ¶
func GetLoaders ¶
func GetLoaders(db *DB) map[string]*dataloader.Loader
func Marshal_Any ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func Unmarshal_Any ¶
func Unmarshal_Any(v interface{}) (interface{}, error)
Types ¶
type ComplexityRoot ¶
type ComplexityRoot struct {
Export struct {
CreatedAt func(childComplexity int) int
CreatedBy func(childComplexity int) int
ErrorDescription func(childComplexity int) int
File func(childComplexity int) int
FileID func(childComplexity int) int
ID func(childComplexity int) int
Metadata func(childComplexity int) int
Progress func(childComplexity int) int
State func(childComplexity int) int
Type func(childComplexity int) int
UpdatedAt func(childComplexity int) int
UpdatedBy func(childComplexity int) int
}
ExportResultType struct {
Count func(childComplexity int) int
Items func(childComplexity int) int
}
File struct {
ID func(childComplexity int) int
}
Mutation struct {
CreateExport func(childComplexity int, input map[string]interface{}) int
DeleteAllExports func(childComplexity int) int
DeleteExport func(childComplexity int, id string) int
UpdateExport func(childComplexity int, id string, input map[string]interface{}) int
}
Query struct {
Export func(childComplexity int, id *string, q *string, filter *ExportFilterType) int
Exports func(childComplexity int, offset *int, limit *int, q *string, sort []*ExportSortType, filter *ExportFilterType) int
// contains filtered or unexported fields
}
// contains filtered or unexported fields
}
type Config ¶
type Config struct {
Resolvers ResolverRoot
Directives DirectiveRoot
Complexity ComplexityRoot
}
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB ...
func NewDBFromEnvVars ¶
func NewDBFromEnvVars() *DB
NewDBFromEnvVars Create database client using DATABASE_URL environment variable
func NewDBWithString ¶
NewDBWithString creates database instance with database URL string
type DirectiveRoot ¶
type DirectiveRoot struct {
}
type EntityFilter ¶
type EntityFilterQuery ¶
type EntityResultType ¶
type EntityResultType struct {
Offset *int
Limit *int
Query EntityFilterQuery
Sort []EntitySort
Filter EntityFilter
Fields []*ast.Field
SelectionSet *ast.SelectionSet
}
func (*EntityResultType) GetCount ¶
func (r *EntityResultType) GetCount(ctx context.Context, db *gorm.DB, out interface{}) (count int, err error)
GetCount ...
func (*EntityResultType) GetItems ¶
func (r *EntityResultType) GetItems(ctx context.Context, db *gorm.DB, opts GetItemsOptions, out interface{}) error
GetResultTypeItems ...
func (*EntityResultType) GetSortStrings ¶
func (r *EntityResultType) GetSortStrings() []string
type EntitySort ¶
type Export ¶
type Export struct {
ID string `json:"id" gorm:"column:id;primary_key"`
Type *string `json:"type" gorm:"column:type"`
Metadata *string `json:"metadata" gorm:"column:metadata;type:text"`
State *ExportState `json:"state" gorm:"column:state"`
Progress *float64 `json:"progress" gorm:"column:progress"`
ErrorDescription *string `json:"errorDescription" gorm:"column:errorDescription"`
FileID *string `json:"fileId" gorm:"column:fileId"`
UpdatedAt *time.Time `json:"updatedAt" gorm:"column:updatedAt"`
CreatedAt time.Time `json:"createdAt" gorm:"column:createdAt"`
UpdatedBy *string `json:"updatedBy" gorm:"column:updatedBy"`
CreatedBy *string `json:"createdBy" gorm:"column:createdBy"`
}
func CreateExportHandler ¶
func DeleteExportHandler ¶
func QueryExportHandler ¶
func QueryExportHandler(ctx context.Context, r *GeneratedResolver, opts QueryExportHandlerOptions) (*Export, error)
func UpdateExportHandler ¶
type ExportChanges ¶
type ExportFilterType ¶
type ExportFilterType struct {
And []*ExportFilterType `json:"AND"`
Or []*ExportFilterType `json:"OR"`
ID *string `json:"id"`
IDNe *string `json:"id_ne"`
IDGt *string `json:"id_gt"`
IDLt *string `json:"id_lt"`
IDGte *string `json:"id_gte"`
IDLte *string `json:"id_lte"`
IDIn []string `json:"id_in"`
IDNull *bool `json:"id_null"`
Type *string `json:"type"`
TypeNe *string `json:"type_ne"`
TypeGt *string `json:"type_gt"`
TypeLt *string `json:"type_lt"`
TypeGte *string `json:"type_gte"`
TypeLte *string `json:"type_lte"`
TypeIn []string `json:"type_in"`
TypeLike *string `json:"type_like"`
TypePrefix *string `json:"type_prefix"`
TypeSuffix *string `json:"type_suffix"`
TypeNull *bool `json:"type_null"`
Metadata *string `json:"metadata"`
MetadataNe *string `json:"metadata_ne"`
MetadataGt *string `json:"metadata_gt"`
MetadataLt *string `json:"metadata_lt"`
MetadataGte *string `json:"metadata_gte"`
MetadataLte *string `json:"metadata_lte"`
MetadataIn []string `json:"metadata_in"`
MetadataLike *string `json:"metadata_like"`
MetadataPrefix *string `json:"metadata_prefix"`
MetadataSuffix *string `json:"metadata_suffix"`
MetadataNull *bool `json:"metadata_null"`
State *ExportState `json:"state"`
StateNe *ExportState `json:"state_ne"`
StateGt *ExportState `json:"state_gt"`
StateLt *ExportState `json:"state_lt"`
StateGte *ExportState `json:"state_gte"`
StateLte *ExportState `json:"state_lte"`
StateIn []ExportState `json:"state_in"`
StateNull *bool `json:"state_null"`
Progress *float64 `json:"progress"`
ProgressNe *float64 `json:"progress_ne"`
ProgressGt *float64 `json:"progress_gt"`
ProgressLt *float64 `json:"progress_lt"`
ProgressGte *float64 `json:"progress_gte"`
ProgressLte *float64 `json:"progress_lte"`
ProgressIn []float64 `json:"progress_in"`
ProgressNull *bool `json:"progress_null"`
ErrorDescription *string `json:"errorDescription"`
ErrorDescriptionNe *string `json:"errorDescription_ne"`
ErrorDescriptionGt *string `json:"errorDescription_gt"`
ErrorDescriptionLt *string `json:"errorDescription_lt"`
ErrorDescriptionGte *string `json:"errorDescription_gte"`
ErrorDescriptionLte *string `json:"errorDescription_lte"`
ErrorDescriptionIn []string `json:"errorDescription_in"`
ErrorDescriptionLike *string `json:"errorDescription_like"`
ErrorDescriptionPrefix *string `json:"errorDescription_prefix"`
ErrorDescriptionSuffix *string `json:"errorDescription_suffix"`
ErrorDescriptionNull *bool `json:"errorDescription_null"`
FileID *string `json:"fileId"`
FileIDNe *string `json:"fileId_ne"`
FileIDGt *string `json:"fileId_gt"`
FileIDLt *string `json:"fileId_lt"`
FileIDGte *string `json:"fileId_gte"`
FileIDLte *string `json:"fileId_lte"`
FileIDIn []string `json:"fileId_in"`
FileIDLike *string `json:"fileId_like"`
FileIDPrefix *string `json:"fileId_prefix"`
FileIDSuffix *string `json:"fileId_suffix"`
FileIDNull *bool `json:"fileId_null"`
UpdatedAt *time.Time `json:"updatedAt"`
UpdatedAtNe *time.Time `json:"updatedAt_ne"`
UpdatedAtGt *time.Time `json:"updatedAt_gt"`
UpdatedAtLt *time.Time `json:"updatedAt_lt"`
UpdatedAtGte *time.Time `json:"updatedAt_gte"`
UpdatedAtLte *time.Time `json:"updatedAt_lte"`
UpdatedAtIn []*time.Time `json:"updatedAt_in"`
UpdatedAtNull *bool `json:"updatedAt_null"`
CreatedAt *time.Time `json:"createdAt"`
CreatedAtNe *time.Time `json:"createdAt_ne"`
CreatedAtGt *time.Time `json:"createdAt_gt"`
CreatedAtLt *time.Time `json:"createdAt_lt"`
CreatedAtGte *time.Time `json:"createdAt_gte"`
CreatedAtLte *time.Time `json:"createdAt_lte"`
CreatedAtIn []*time.Time `json:"createdAt_in"`
CreatedAtNull *bool `json:"createdAt_null"`
UpdatedBy *string `json:"updatedBy"`
UpdatedByNe *string `json:"updatedBy_ne"`
UpdatedByGt *string `json:"updatedBy_gt"`
UpdatedByLt *string `json:"updatedBy_lt"`
UpdatedByGte *string `json:"updatedBy_gte"`
UpdatedByLte *string `json:"updatedBy_lte"`
UpdatedByIn []string `json:"updatedBy_in"`
UpdatedByNull *bool `json:"updatedBy_null"`
CreatedBy *string `json:"createdBy"`
CreatedByNe *string `json:"createdBy_ne"`
CreatedByGt *string `json:"createdBy_gt"`
CreatedByLt *string `json:"createdBy_lt"`
CreatedByGte *string `json:"createdBy_gte"`
CreatedByLte *string `json:"createdBy_lte"`
CreatedByIn []string `json:"createdBy_in"`
CreatedByNull *bool `json:"createdBy_null"`
}
func (*ExportFilterType) AndWith ¶
func (f *ExportFilterType) AndWith(f2 ...*ExportFilterType) *ExportFilterType
AndWith convenience method for combining two or more filters with AND statement
func (*ExportFilterType) ApplyWithAlias ¶
func (*ExportFilterType) OrWith ¶
func (f *ExportFilterType) OrWith(f2 ...*ExportFilterType) *ExportFilterType
OrWith convenience method for combining two or more filters with OR statement
func (*ExportFilterType) WhereContent ¶
func (f *ExportFilterType) WhereContent(dialect gorm.Dialect, aliasPrefix string) (conditions []string, values []interface{})
type ExportQueryFilter ¶
type ExportQueryFilter struct {
Query *string
}
type ExportResolver ¶
type ExportResultType ¶
type ExportResultType struct {
EntityResultType
}
func QueryExportsHandler ¶
func QueryExportsHandler(ctx context.Context, r *GeneratedResolver, opts QueryExportsHandlerOptions) (*ExportResultType, error)
type ExportResultTypeResolver ¶
type ExportResultTypeResolver interface {
Items(ctx context.Context, obj *ExportResultType) ([]*Export, error)
Count(ctx context.Context, obj *ExportResultType) (int, error)
}
type ExportSortType ¶
type ExportSortType struct {
ID *ObjectSortType `json:"id"`
Type *ObjectSortType `json:"type"`
Metadata *ObjectSortType `json:"metadata"`
State *ObjectSortType `json:"state"`
Progress *ObjectSortType `json:"progress"`
ErrorDescription *ObjectSortType `json:"errorDescription"`
FileID *ObjectSortType `json:"fileId"`
UpdatedAt *ObjectSortType `json:"updatedAt"`
CreatedAt *ObjectSortType `json:"createdAt"`
UpdatedBy *ObjectSortType `json:"updatedBy"`
CreatedBy *ObjectSortType `json:"createdBy"`
}
type ExportState ¶ added in v0.1.3
type ExportState string
const ( ExportStateProcessing ExportState = "PROCESSING" ExportStateCompleted ExportState = "COMPLETED" ExportStateError ExportState = "ERROR" )
func (ExportState) IsValid ¶ added in v0.1.3
func (e ExportState) IsValid() bool
func (ExportState) MarshalGQL ¶ added in v0.1.3
func (e ExportState) MarshalGQL(w io.Writer)
func (ExportState) String ¶ added in v0.1.3
func (e ExportState) String() string
func (*ExportState) UnmarshalGQL ¶ added in v0.1.3
func (e *ExportState) UnmarshalGQL(v interface{}) error
type GeneratedExportResolver ¶
type GeneratedExportResolver struct{ *GeneratedResolver }
type GeneratedExportResultTypeResolver ¶
type GeneratedExportResultTypeResolver struct{ *GeneratedResolver }
func (*GeneratedExportResultTypeResolver) Count ¶
func (r *GeneratedExportResultTypeResolver) Count(ctx context.Context, obj *ExportResultType) (count int, err error)
func (*GeneratedExportResultTypeResolver) Items ¶
func (r *GeneratedExportResultTypeResolver) Items(ctx context.Context, obj *ExportResultType) (items []*Export, err error)
type GeneratedFileResolver ¶
type GeneratedFileResolver struct{ *GeneratedResolver }
type GeneratedMutationResolver ¶
type GeneratedMutationResolver struct{ *GeneratedResolver }
func (*GeneratedMutationResolver) CreateExport ¶
func (*GeneratedMutationResolver) DeleteAllExports ¶
func (r *GeneratedMutationResolver) DeleteAllExports(ctx context.Context) (bool, error)
func (*GeneratedMutationResolver) DeleteExport ¶
func (*GeneratedMutationResolver) UpdateExport ¶
type GeneratedQueryResolver ¶
type GeneratedQueryResolver struct{ *GeneratedResolver }
func (*GeneratedQueryResolver) Export ¶
func (r *GeneratedQueryResolver) Export(ctx context.Context, id *string, q *string, filter *ExportFilterType) (*Export, error)
func (*GeneratedQueryResolver) Exports ¶
func (r *GeneratedQueryResolver) Exports(ctx context.Context, offset *int, limit *int, q *string, sort []*ExportSortType, filter *ExportFilterType) (*ExportResultType, error)
type GeneratedResolver ¶
type GeneratedResolver struct {
Handlers ResolutionHandlers
DB *DB
EventController *events.EventController
}
type GetItemsOptions ¶
type JWTClaims ¶
type JWTClaims struct {
jwtgo.StandardClaims
Scope *string
}
func GetJWTClaimsFromContext ¶
type MutationEvents ¶
func GetMutationEventStore ¶
func GetMutationEventStore(ctx context.Context) *MutationEvents
type MutationResolver ¶
type MutationResolver interface {
CreateExport(ctx context.Context, input map[string]interface{}) (*Export, error)
UpdateExport(ctx context.Context, id string, input map[string]interface{}) (*Export, error)
DeleteExport(ctx context.Context, id string) (*Export, error)
DeleteAllExports(ctx context.Context) (bool, error)
}
type NotFoundError ¶
type NotFoundError struct {
Entity string
}
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type ObjectSortType ¶
type ObjectSortType string
const ( ObjectSortTypeAsc ObjectSortType = "ASC" ObjectSortTypeDesc ObjectSortType = "DESC" )
func (ObjectSortType) IsValid ¶
func (e ObjectSortType) IsValid() bool
func (ObjectSortType) MarshalGQL ¶
func (e ObjectSortType) MarshalGQL(w io.Writer)
func (ObjectSortType) String ¶
func (e ObjectSortType) String() string
func (*ObjectSortType) UnmarshalGQL ¶
func (e *ObjectSortType) UnmarshalGQL(v interface{}) error
type QueryExportHandlerOptions ¶
type QueryExportHandlerOptions struct {
ID *string
Q *string
Filter *ExportFilterType
}
type QueryExportsHandlerOptions ¶
type QueryExportsHandlerOptions struct {
Offset *int
Limit *int
Q *string
Sort []*ExportSortType
Filter *ExportFilterType
}
type QueryResolver ¶
type QueryResolver interface {
Export(ctx context.Context, id *string, q *string, filter *ExportFilterType) (*Export, error)
Exports(ctx context.Context, offset *int, limit *int, q *string, sort []*ExportSortType, filter *ExportFilterType) (*ExportResultType, error)
// contains filtered or unexported methods
}
type ResolutionHandlers ¶
type ResolutionHandlers struct {
OnEvent func(ctx context.Context, r *GeneratedResolver, e *events.Event) error
CreateExport func(ctx context.Context, r *GeneratedResolver, input map[string]interface{}) (item *Export, err error)
UpdateExport func(ctx context.Context, r *GeneratedResolver, id string, input map[string]interface{}) (item *Export, err error)
DeleteExport func(ctx context.Context, r *GeneratedResolver, id string) (item *Export, err error)
DeleteAllExports func(ctx context.Context, r *GeneratedResolver) (bool, error)
QueryExport func(ctx context.Context, r *GeneratedResolver, opts QueryExportHandlerOptions) (*Export, error)
QueryExports func(ctx context.Context, r *GeneratedResolver, opts QueryExportsHandlerOptions) (*ExportResultType, error)
ExportFile func(ctx context.Context, r *GeneratedResolver, obj *Export) (res *File, err error)
}
func DefaultResolutionHandlers ¶
func DefaultResolutionHandlers() ResolutionHandlers
type ResolverRoot ¶
type ResolverRoot interface {
Export() ExportResolver
ExportResultType() ExportResultTypeResolver
Mutation() MutationResolver
Query() QueryResolver
}
Click to show internal directories.
Click to hide internal directories.