Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyChanges(changes map[string]interface{}, to interface{}) error
- func DeleteAllNotificationsHandler(ctx context.Context, r *GeneratedResolver) (bool, error)
- func GetHTTPServeMux(r ResolverRoot, db *DB) *http.ServeMux
- func GetLoaders(db *DB) map[string]*dataloader.Loader
- func GetPrincipalIDFromContext(ctx context.Context) *string
- 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 GeneratedMutationResolver
- func (r *GeneratedMutationResolver) CreateNotification(ctx context.Context, input map[string]interface{}) (item *Notification, err error)
- func (r *GeneratedMutationResolver) DeleteAllNotifications(ctx context.Context) (bool, error)
- func (r *GeneratedMutationResolver) DeleteNotification(ctx context.Context, id string) (item *Notification, err error)
- func (r *GeneratedMutationResolver) UpdateNotification(ctx context.Context, id string, input map[string]interface{}) (item *Notification, err error)
- type GeneratedNotificationResultTypeResolver
- type GeneratedQueryResolver
- type GeneratedResolver
- type JWTClaims
- type MutationResolver
- type NotFoundError
- type Notification
- func CreateNotificationHandler(ctx context.Context, r *GeneratedResolver, input map[string]interface{}) (item *Notification, err error)
- func DeleteNotificationHandler(ctx context.Context, r *GeneratedResolver, id string) (item *Notification, err error)
- func QueryNotificationHandler(ctx context.Context, r *GeneratedResolver, ...) (*Notification, error)
- func UpdateNotificationHandler(ctx context.Context, r *GeneratedResolver, id string, ...) (item *Notification, err error)
- type NotificationChanges
- type NotificationFilterType
- func (f *NotificationFilterType) AndWith(f2 ...*NotificationFilterType) *NotificationFilterType
- func (f *NotificationFilterType) Apply(ctx context.Context, dialect gorm.Dialect, wheres *[]string, ...) error
- func (f *NotificationFilterType) ApplyWithAlias(ctx context.Context, dialect gorm.Dialect, alias string, wheres *[]string, ...) error
- func (f *NotificationFilterType) IsEmpty(ctx context.Context, dialect gorm.Dialect) bool
- func (f *NotificationFilterType) OrWith(f2 ...*NotificationFilterType) *NotificationFilterType
- func (f *NotificationFilterType) WhereContent(dialect gorm.Dialect, aliasPrefix string) (conditions []string, values []interface{})
- type NotificationQueryFilter
- type NotificationResultType
- type NotificationResultTypeResolver
- type NotificationSortType
- type QueryNotificationHandlerOptions
- type QueryNotificationsHandlerOptions
- type QueryResolver
- type ResolutionHandlers
- type ResolverRoot
Constants ¶
Variables ¶
View Source
var AllNotificationSortType = []NotificationSortType{ NotificationSortTypeIDAsc, NotificationSortTypeIDDesc, NotificationSortTypeMessageAsc, NotificationSortTypeMessageDesc, NotificationSortTypeSeenAsc, NotificationSortTypeSeenDesc, NotificationSortTypeChannelAsc, NotificationSortTypeChannelDesc, NotificationSortTypePrincipalAsc, NotificationSortTypePrincipalDesc, NotificationSortTypeReferenceAsc, NotificationSortTypeReferenceDesc, NotificationSortTypeReferenceIDAsc, NotificationSortTypeReferenceIDDesc, NotificationSortTypeDateAsc, NotificationSortTypeDateDesc, NotificationSortTypeUpdatedAtAsc, NotificationSortTypeUpdatedAtDesc, NotificationSortTypeCreatedAtAsc, NotificationSortTypeCreatedAtDesc, NotificationSortTypeUpdatedByAsc, NotificationSortTypeUpdatedByDesc, NotificationSortTypeCreatedByAsc, NotificationSortTypeCreatedByDesc, }
Functions ¶
func ApplyChanges ¶
used to convert map[string]interface{} to EntityChanges struct
func DeleteAllNotificationsHandler ¶
func DeleteAllNotificationsHandler(ctx context.Context, r *GeneratedResolver) (bool, error)
func GetHTTPServeMux ¶
func GetHTTPServeMux(r ResolverRoot, db *DB) *http.ServeMux
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 {
Mutation struct {
CreateNotification func(childComplexity int, input map[string]interface{}) int
DeleteAllNotifications func(childComplexity int) int
DeleteNotification func(childComplexity int, id string) int
SeenNotification func(childComplexity int, id string) int
SeenNotifications func(childComplexity int, principal string, channel *string, reference *string, referenceID *string) int
UpdateNotification func(childComplexity int, id string, input map[string]interface{}) int
}
Notification struct {
Channel func(childComplexity int) int
CreatedAt func(childComplexity int) int
CreatedBy func(childComplexity int) int
Date func(childComplexity int) int
ID func(childComplexity int) int
Message func(childComplexity int) int
Principal func(childComplexity int) int
Reference func(childComplexity int) int
ReferenceID func(childComplexity int) int
Seen func(childComplexity int) int
UpdatedAt func(childComplexity int) int
UpdatedBy func(childComplexity int) int
}
NotificationResultType struct {
Count func(childComplexity int) int
Items func(childComplexity int) int
}
Query struct {
Notification func(childComplexity int, id *string, q *string, filter *NotificationFilterType) int
Notifications func(childComplexity int, offset *int, limit *int, q *string, sort []NotificationSortType, filter *NotificationFilterType) 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
type DirectiveRoot ¶
type DirectiveRoot struct {
}
type GeneratedMutationResolver ¶
type GeneratedMutationResolver struct{ *GeneratedResolver }
func (*GeneratedMutationResolver) CreateNotification ¶
func (r *GeneratedMutationResolver) CreateNotification(ctx context.Context, input map[string]interface{}) (item *Notification, err error)
func (*GeneratedMutationResolver) DeleteAllNotifications ¶
func (r *GeneratedMutationResolver) DeleteAllNotifications(ctx context.Context) (bool, error)
func (*GeneratedMutationResolver) DeleteNotification ¶
func (r *GeneratedMutationResolver) DeleteNotification(ctx context.Context, id string) (item *Notification, err error)
func (*GeneratedMutationResolver) UpdateNotification ¶
func (r *GeneratedMutationResolver) UpdateNotification(ctx context.Context, id string, input map[string]interface{}) (item *Notification, err error)
type GeneratedNotificationResultTypeResolver ¶
type GeneratedNotificationResultTypeResolver struct{ *GeneratedResolver }
func (*GeneratedNotificationResultTypeResolver) Count ¶
func (r *GeneratedNotificationResultTypeResolver) Count(ctx context.Context, obj *NotificationResultType) (count int, err error)
func (*GeneratedNotificationResultTypeResolver) Items ¶
func (r *GeneratedNotificationResultTypeResolver) Items(ctx context.Context, obj *NotificationResultType) (items []*Notification, err error)
type GeneratedQueryResolver ¶
type GeneratedQueryResolver struct{ *GeneratedResolver }
func (*GeneratedQueryResolver) Notification ¶
func (r *GeneratedQueryResolver) Notification(ctx context.Context, id *string, q *string, filter *NotificationFilterType) (*Notification, error)
func (*GeneratedQueryResolver) Notifications ¶
func (r *GeneratedQueryResolver) Notifications(ctx context.Context, offset *int, limit *int, q *string, sort []NotificationSortType, filter *NotificationFilterType) (*NotificationResultType, error)
type GeneratedResolver ¶
type GeneratedResolver struct {
Handlers ResolutionHandlers
DB *DB
EventController *events.EventController
}
type JWTClaims ¶
type JWTClaims struct {
jwtgo.StandardClaims
Scope *string
}
type MutationResolver ¶
type MutationResolver interface {
CreateNotification(ctx context.Context, input map[string]interface{}) (*Notification, error)
UpdateNotification(ctx context.Context, id string, input map[string]interface{}) (*Notification, error)
DeleteNotification(ctx context.Context, id string) (*Notification, error)
DeleteAllNotifications(ctx context.Context) (bool, error)
SeenNotification(ctx context.Context, id string) (*Notification, error)
SeenNotifications(ctx context.Context, principal string, channel *string, reference *string, referenceID *string) (bool, error)
}
type NotFoundError ¶
type NotFoundError struct {
Entity string
}
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type Notification ¶
type Notification struct {
ID string `json:"id" gorm:"column:id;primary_key"`
Message string `json:"message" gorm:"column:message;type:text"`
Seen bool `json:"seen" gorm:"column:seen"`
Channel *string `json:"channel" gorm:"column:channel"`
Principal *string `json:"principal" gorm:"column:principal"`
Reference *string `json:"reference" gorm:"column:reference"`
ReferenceID *string `json:"referenceID" gorm:"column:referenceID"`
Date time.Time `json:"date" gorm:"column:date"`
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 CreateNotificationHandler ¶
func CreateNotificationHandler(ctx context.Context, r *GeneratedResolver, input map[string]interface{}) (item *Notification, err error)
func DeleteNotificationHandler ¶
func DeleteNotificationHandler(ctx context.Context, r *GeneratedResolver, id string) (item *Notification, err error)
func QueryNotificationHandler ¶
func QueryNotificationHandler(ctx context.Context, r *GeneratedResolver, opts QueryNotificationHandlerOptions) (*Notification, error)
func UpdateNotificationHandler ¶
func UpdateNotificationHandler(ctx context.Context, r *GeneratedResolver, id string, input map[string]interface{}) (item *Notification, err error)
func (*Notification) Is_Entity ¶
func (m *Notification) Is_Entity()
type NotificationChanges ¶
type NotificationFilterType ¶
type NotificationFilterType struct {
And []*NotificationFilterType `json:"AND"`
Or []*NotificationFilterType `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"`
Message *string `json:"message"`
MessageNe *string `json:"message_ne"`
MessageGt *string `json:"message_gt"`
MessageLt *string `json:"message_lt"`
MessageGte *string `json:"message_gte"`
MessageLte *string `json:"message_lte"`
MessageIn []string `json:"message_in"`
MessageLike *string `json:"message_like"`
MessagePrefix *string `json:"message_prefix"`
MessageSuffix *string `json:"message_suffix"`
Seen *bool `json:"seen"`
SeenNe *bool `json:"seen_ne"`
SeenGt *bool `json:"seen_gt"`
SeenLt *bool `json:"seen_lt"`
SeenGte *bool `json:"seen_gte"`
SeenLte *bool `json:"seen_lte"`
SeenIn []bool `json:"seen_in"`
Channel *string `json:"channel"`
ChannelNe *string `json:"channel_ne"`
ChannelGt *string `json:"channel_gt"`
ChannelLt *string `json:"channel_lt"`
ChannelGte *string `json:"channel_gte"`
ChannelLte *string `json:"channel_lte"`
ChannelIn []string `json:"channel_in"`
ChannelLike *string `json:"channel_like"`
ChannelPrefix *string `json:"channel_prefix"`
ChannelSuffix *string `json:"channel_suffix"`
Principal *string `json:"principal"`
PrincipalNe *string `json:"principal_ne"`
PrincipalGt *string `json:"principal_gt"`
PrincipalLt *string `json:"principal_lt"`
PrincipalGte *string `json:"principal_gte"`
PrincipalLte *string `json:"principal_lte"`
PrincipalIn []string `json:"principal_in"`
PrincipalLike *string `json:"principal_like"`
PrincipalPrefix *string `json:"principal_prefix"`
PrincipalSuffix *string `json:"principal_suffix"`
Reference *string `json:"reference"`
ReferenceNe *string `json:"reference_ne"`
ReferenceGt *string `json:"reference_gt"`
ReferenceLt *string `json:"reference_lt"`
ReferenceGte *string `json:"reference_gte"`
ReferenceLte *string `json:"reference_lte"`
ReferenceIn []string `json:"reference_in"`
ReferenceLike *string `json:"reference_like"`
ReferencePrefix *string `json:"reference_prefix"`
ReferenceSuffix *string `json:"reference_suffix"`
ReferenceID *string `json:"referenceID"`
ReferenceIDNe *string `json:"referenceID_ne"`
ReferenceIDGt *string `json:"referenceID_gt"`
ReferenceIDLt *string `json:"referenceID_lt"`
ReferenceIDGte *string `json:"referenceID_gte"`
ReferenceIDLte *string `json:"referenceID_lte"`
ReferenceIDIn []string `json:"referenceID_in"`
ReferenceIDLike *string `json:"referenceID_like"`
ReferenceIDPrefix *string `json:"referenceID_prefix"`
ReferenceIDSuffix *string `json:"referenceID_suffix"`
Date *time.Time `json:"date"`
DateNe *time.Time `json:"date_ne"`
DateGt *time.Time `json:"date_gt"`
DateLt *time.Time `json:"date_lt"`
DateGte *time.Time `json:"date_gte"`
DateLte *time.Time `json:"date_lte"`
DateIn []*time.Time `json:"date_in"`
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"`
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"`
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"`
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"`
}
func (*NotificationFilterType) AndWith ¶
func (f *NotificationFilterType) AndWith(f2 ...*NotificationFilterType) *NotificationFilterType
AndWith convenience method for combining two or more filters with AND statement
func (*NotificationFilterType) ApplyWithAlias ¶
func (*NotificationFilterType) OrWith ¶
func (f *NotificationFilterType) OrWith(f2 ...*NotificationFilterType) *NotificationFilterType
OrWith convenience method for combining two or more filters with OR statement
func (*NotificationFilterType) WhereContent ¶
func (f *NotificationFilterType) WhereContent(dialect gorm.Dialect, aliasPrefix string) (conditions []string, values []interface{})
type NotificationQueryFilter ¶
type NotificationQueryFilter struct {
Query *string
}
type NotificationResultType ¶
type NotificationResultType struct {
resolvers.EntityResultType
}
func QueryNotificationsHandler ¶
func QueryNotificationsHandler(ctx context.Context, r *GeneratedResolver, opts QueryNotificationsHandlerOptions) (*NotificationResultType, error)
type NotificationResultTypeResolver ¶
type NotificationResultTypeResolver interface {
Items(ctx context.Context, obj *NotificationResultType) ([]*Notification, error)
Count(ctx context.Context, obj *NotificationResultType) (int, error)
}
type NotificationSortType ¶
type NotificationSortType string
const ( NotificationSortTypeIDAsc NotificationSortType = "ID_ASC" NotificationSortTypeIDDesc NotificationSortType = "ID_DESC" NotificationSortTypeMessageAsc NotificationSortType = "MESSAGE_ASC" NotificationSortTypeMessageDesc NotificationSortType = "MESSAGE_DESC" NotificationSortTypeSeenAsc NotificationSortType = "SEEN_ASC" NotificationSortTypeSeenDesc NotificationSortType = "SEEN_DESC" NotificationSortTypeChannelAsc NotificationSortType = "CHANNEL_ASC" NotificationSortTypeChannelDesc NotificationSortType = "CHANNEL_DESC" NotificationSortTypePrincipalAsc NotificationSortType = "PRINCIPAL_ASC" NotificationSortTypePrincipalDesc NotificationSortType = "PRINCIPAL_DESC" NotificationSortTypeReferenceAsc NotificationSortType = "REFERENCE_ASC" NotificationSortTypeReferenceDesc NotificationSortType = "REFERENCE_DESC" NotificationSortTypeReferenceIDAsc NotificationSortType = "REFERENCE_ID_ASC" NotificationSortTypeReferenceIDDesc NotificationSortType = "REFERENCE_ID_DESC" NotificationSortTypeDateAsc NotificationSortType = "DATE_ASC" NotificationSortTypeDateDesc NotificationSortType = "DATE_DESC" NotificationSortTypeUpdatedAtAsc NotificationSortType = "UPDATED_AT_ASC" NotificationSortTypeUpdatedAtDesc NotificationSortType = "UPDATED_AT_DESC" NotificationSortTypeCreatedAtAsc NotificationSortType = "CREATED_AT_ASC" NotificationSortTypeCreatedAtDesc NotificationSortType = "CREATED_AT_DESC" NotificationSortTypeUpdatedByAsc NotificationSortType = "UPDATED_BY_ASC" NotificationSortTypeUpdatedByDesc NotificationSortType = "UPDATED_BY_DESC" NotificationSortTypeCreatedByAsc NotificationSortType = "CREATED_BY_ASC" NotificationSortTypeCreatedByDesc NotificationSortType = "CREATED_BY_DESC" )
func (NotificationSortType) IsValid ¶
func (e NotificationSortType) IsValid() bool
func (NotificationSortType) MarshalGQL ¶
func (e NotificationSortType) MarshalGQL(w io.Writer)
func (NotificationSortType) String ¶
func (e NotificationSortType) String() string
func (*NotificationSortType) UnmarshalGQL ¶
func (e *NotificationSortType) UnmarshalGQL(v interface{}) error
type QueryNotificationHandlerOptions ¶
type QueryNotificationHandlerOptions struct {
ID *string
Q *string
Filter *NotificationFilterType
}
type QueryNotificationsHandlerOptions ¶
type QueryNotificationsHandlerOptions struct {
Offset *int
Limit *int
Q *string
Sort []NotificationSortType
Filter *NotificationFilterType
}
type QueryResolver ¶
type QueryResolver interface {
Notification(ctx context.Context, id *string, q *string, filter *NotificationFilterType) (*Notification, error)
Notifications(ctx context.Context, offset *int, limit *int, q *string, sort []NotificationSortType, filter *NotificationFilterType) (*NotificationResultType, error)
// contains filtered or unexported methods
}
type ResolutionHandlers ¶
type ResolutionHandlers struct {
CreateNotification func(ctx context.Context, r *GeneratedResolver, input map[string]interface{}) (item *Notification, err error)
UpdateNotification func(ctx context.Context, r *GeneratedResolver, id string, input map[string]interface{}) (item *Notification, err error)
DeleteNotification func(ctx context.Context, r *GeneratedResolver, id string) (item *Notification, err error)
DeleteAllNotifications func(ctx context.Context, r *GeneratedResolver) (bool, error)
QueryNotification func(ctx context.Context, r *GeneratedResolver, opts QueryNotificationHandlerOptions) (*Notification, error)
QueryNotifications func(ctx context.Context, r *GeneratedResolver, opts QueryNotificationsHandlerOptions) (*NotificationResultType, error)
}
func DefaultResolutionHandlers ¶
func DefaultResolutionHandlers() ResolutionHandlers
type ResolverRoot ¶
type ResolverRoot interface {
Mutation() MutationResolver
NotificationResultType() NotificationResultTypeResolver
Query() QueryResolver
}
Click to show internal directories.
Click to hide internal directories.