Documentation
¶
Index ¶
- func CreateService(srv GraphQLServiceRPC, options []connect.HandlerOption) (*api.Service, error)
- func ToAPIGraphQL(g mgraphql.GraphQL) *graphqlv1.GraphQL
- func ToAPIGraphQLAssert(a mgraphql.GraphQLAssert) *graphqlv1.GraphQLAssert
- func ToAPIGraphQLHeader(h mgraphql.GraphQLHeader) *graphqlv1.GraphQLHeader
- func ToAPIGraphQLResponse(r mgraphql.GraphQLResponse) *graphqlv1.GraphQLResponse
- func ToAPIGraphQLResponseAssert(a mgraphql.GraphQLResponseAssert) *graphqlv1.GraphQLResponseAssert
- func ToAPIGraphQLResponseHeader(h mgraphql.GraphQLResponseHeader) *graphqlv1.GraphQLResponseHeader
- func ToAPIGraphQLVersion(version mgraphql.GraphQLVersion) *graphqlv1.GraphQLVersion
- type AssertionResult
- type GraphQLAssertEvent
- type GraphQLAssertTopic
- type GraphQLEvent
- type GraphQLHeaderEvent
- type GraphQLHeaderTopic
- type GraphQLResolver
- type GraphQLResponseAssertEvent
- type GraphQLResponseAssertTopic
- type GraphQLResponseData
- type GraphQLResponseEvent
- type GraphQLResponseHeaderEvent
- type GraphQLResponseHeaderTopic
- type GraphQLResponseTopic
- type GraphQLServiceRPC
- func (s *GraphQLServiceRPC) GraphQLAssertCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[graphqlv1.GraphQLAssertCollectionResponse], error)
- func (s *GraphQLServiceRPC) GraphQLAssertDelete(ctx context.Context, ...) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLAssertDeltaCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[graphqlv1.GraphQLAssertDeltaCollectionResponse], error)
- func (s *GraphQLServiceRPC) GraphQLAssertDeltaDelete(ctx context.Context, ...) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLAssertDeltaInsert(ctx context.Context, ...) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLAssertDeltaSync(ctx context.Context, req *connect.Request[emptypb.Empty], ...) error
- func (s *GraphQLServiceRPC) GraphQLAssertDeltaUpdate(ctx context.Context, ...) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLAssertInsert(ctx context.Context, ...) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLAssertSync(ctx context.Context, req *connect.Request[emptypb.Empty], ...) error
- func (s *GraphQLServiceRPC) GraphQLAssertUpdate(ctx context.Context, ...) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[graphqlv1.GraphQLCollectionResponse], error)
- func (s *GraphQLServiceRPC) GraphQLDelete(ctx context.Context, req *connect.Request[graphqlv1.GraphQLDeleteRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLDeltaCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[graphqlv1.GraphQLDeltaCollectionResponse], error)
- func (s *GraphQLServiceRPC) GraphQLDeltaDelete(ctx context.Context, req *connect.Request[graphqlv1.GraphQLDeltaDeleteRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLDeltaInsert(ctx context.Context, req *connect.Request[graphqlv1.GraphQLDeltaInsertRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLDeltaSync(ctx context.Context, req *connect.Request[emptypb.Empty], ...) error
- func (s *GraphQLServiceRPC) GraphQLDeltaUpdate(ctx context.Context, req *connect.Request[graphqlv1.GraphQLDeltaUpdateRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLDuplicate(ctx context.Context, req *connect.Request[graphqlv1.GraphQLDuplicateRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLHeaderCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[graphqlv1.GraphQLHeaderCollectionResponse], error)
- func (s *GraphQLServiceRPC) GraphQLHeaderDelete(ctx context.Context, ...) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLHeaderDeltaCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[graphqlv1.GraphQLHeaderDeltaCollectionResponse], error)
- func (s *GraphQLServiceRPC) GraphQLHeaderDeltaDelete(ctx context.Context, ...) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLHeaderDeltaInsert(ctx context.Context, ...) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLHeaderDeltaSync(ctx context.Context, req *connect.Request[emptypb.Empty], ...) error
- func (s *GraphQLServiceRPC) GraphQLHeaderDeltaUpdate(ctx context.Context, ...) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLHeaderInsert(ctx context.Context, ...) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLHeaderSync(ctx context.Context, req *connect.Request[emptypb.Empty], ...) error
- func (s *GraphQLServiceRPC) GraphQLHeaderUpdate(ctx context.Context, ...) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLInsert(ctx context.Context, req *connect.Request[graphqlv1.GraphQLInsertRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLIntrospect(ctx context.Context, req *connect.Request[graphqlv1.GraphQLIntrospectRequest]) (*connect.Response[graphqlv1.GraphQLIntrospectResponse], error)
- func (s *GraphQLServiceRPC) GraphQLResponseAssertCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[graphqlv1.GraphQLResponseAssertCollectionResponse], error)
- func (s *GraphQLServiceRPC) GraphQLResponseAssertSync(ctx context.Context, req *connect.Request[emptypb.Empty], ...) error
- func (s *GraphQLServiceRPC) GraphQLResponseCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[graphqlv1.GraphQLResponseCollectionResponse], error)
- func (s *GraphQLServiceRPC) GraphQLResponseHeaderCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[graphqlv1.GraphQLResponseHeaderCollectionResponse], error)
- func (s *GraphQLServiceRPC) GraphQLResponseHeaderSync(ctx context.Context, req *connect.Request[emptypb.Empty], ...) error
- func (s *GraphQLServiceRPC) GraphQLResponseSync(ctx context.Context, req *connect.Request[emptypb.Empty], ...) error
- func (s *GraphQLServiceRPC) GraphQLRun(ctx context.Context, req *connect.Request[graphqlv1.GraphQLRunRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLSync(ctx context.Context, req *connect.Request[emptypb.Empty], ...) error
- func (s *GraphQLServiceRPC) GraphQLUpdate(ctx context.Context, req *connect.Request[graphqlv1.GraphQLUpdateRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *GraphQLServiceRPC) GraphQLVersionCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[graphqlv1.GraphQLVersionCollectionResponse], error)
- func (s *GraphQLServiceRPC) GraphQLVersionSync(ctx context.Context, req *connect.Request[emptypb.Empty], ...) error
- type GraphQLServiceRPCDeps
- type GraphQLServiceRPCReaders
- type GraphQLServiceRPCServices
- type GraphQLStreamers
- type GraphQLTopic
- type GraphQLVersionEvent
- type GraphQLVersionTopic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateService ¶
func CreateService(srv GraphQLServiceRPC, options []connect.HandlerOption) (*api.Service, error)
func ToAPIGraphQLAssert ¶
func ToAPIGraphQLAssert(a mgraphql.GraphQLAssert) *graphqlv1.GraphQLAssert
func ToAPIGraphQLHeader ¶
func ToAPIGraphQLHeader(h mgraphql.GraphQLHeader) *graphqlv1.GraphQLHeader
func ToAPIGraphQLResponse ¶
func ToAPIGraphQLResponse(r mgraphql.GraphQLResponse) *graphqlv1.GraphQLResponse
func ToAPIGraphQLResponseAssert ¶
func ToAPIGraphQLResponseAssert(a mgraphql.GraphQLResponseAssert) *graphqlv1.GraphQLResponseAssert
func ToAPIGraphQLResponseHeader ¶
func ToAPIGraphQLResponseHeader(h mgraphql.GraphQLResponseHeader) *graphqlv1.GraphQLResponseHeader
func ToAPIGraphQLVersion ¶
func ToAPIGraphQLVersion(version mgraphql.GraphQLVersion) *graphqlv1.GraphQLVersion
ToAPIGraphQLVersion converts model to API type
Types ¶
type AssertionResult ¶
type AssertionResult struct {
AssertionID idwrap.IDWrap
Expression string
Success bool
Error error
EvaluatedAt time.Time
}
AssertionResult represents the result of evaluating a single assertion
type GraphQLAssertEvent ¶
type GraphQLAssertEvent struct {
Type string
GraphQLAssert *graphqlv1.GraphQLAssert
IsDelta bool
}
type GraphQLAssertTopic ¶
type GraphQLEvent ¶
type GraphQLHeaderEvent ¶
type GraphQLHeaderEvent struct {
Type string
GraphQLHeader *graphqlv1.GraphQLHeader
IsDelta bool
}
type GraphQLHeaderTopic ¶
type GraphQLResolver ¶
type GraphQLResolver interface {
Resolve(ctx context.Context, baseID idwrap.IDWrap, deltaID *idwrap.IDWrap) (*delta.ResolveGraphQLOutput, error)
}
GraphQLResolver defines the interface for resolving GraphQL delta requests
type GraphQLResponseAssertEvent ¶
type GraphQLResponseAssertEvent struct {
Type string
GraphQLResponseAssert *graphqlv1.GraphQLResponseAssert
}
type GraphQLResponseData ¶
GraphQLResponseData wraps the response for assertion evaluation
type GraphQLResponseEvent ¶
type GraphQLResponseEvent struct {
Type string
GraphQLResponse *graphqlv1.GraphQLResponse
}
type GraphQLResponseHeaderEvent ¶
type GraphQLResponseHeaderEvent struct {
Type string
GraphQLResponseHeader *graphqlv1.GraphQLResponseHeader
}
type GraphQLResponseTopic ¶
type GraphQLServiceRPC ¶
GraphQLServiceRPC handles GraphQL RPC operations
func New ¶
func New(deps GraphQLServiceRPCDeps) GraphQLServiceRPC
func (*GraphQLServiceRPC) GraphQLAssertCollection ¶
func (*GraphQLServiceRPC) GraphQLAssertDelete ¶
func (*GraphQLServiceRPC) GraphQLAssertDeltaCollection ¶
func (s *GraphQLServiceRPC) GraphQLAssertDeltaCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[graphqlv1.GraphQLAssertDeltaCollectionResponse], error)
Delta operations
func (*GraphQLServiceRPC) GraphQLAssertDeltaDelete ¶
func (*GraphQLServiceRPC) GraphQLAssertDeltaInsert ¶
func (*GraphQLServiceRPC) GraphQLAssertDeltaSync ¶
func (s *GraphQLServiceRPC) GraphQLAssertDeltaSync(ctx context.Context, req *connect.Request[emptypb.Empty], stream *connect.ServerStream[graphqlv1.GraphQLAssertDeltaSyncResponse]) error
func (*GraphQLServiceRPC) GraphQLAssertDeltaUpdate ¶
func (*GraphQLServiceRPC) GraphQLAssertInsert ¶
func (*GraphQLServiceRPC) GraphQLAssertSync ¶
func (s *GraphQLServiceRPC) GraphQLAssertSync(ctx context.Context, req *connect.Request[emptypb.Empty], stream *connect.ServerStream[graphqlv1.GraphQLAssertSyncResponse]) error
func (*GraphQLServiceRPC) GraphQLAssertUpdate ¶
func (*GraphQLServiceRPC) GraphQLCollection ¶
func (*GraphQLServiceRPC) GraphQLDelete ¶
func (*GraphQLServiceRPC) GraphQLDeltaCollection ¶
func (s *GraphQLServiceRPC) GraphQLDeltaCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[graphqlv1.GraphQLDeltaCollectionResponse], error)
GraphQLDeltaCollection fetches all delta GraphQL entries for the user's workspaces
func (*GraphQLServiceRPC) GraphQLDeltaDelete ¶
func (s *GraphQLServiceRPC) GraphQLDeltaDelete(ctx context.Context, req *connect.Request[graphqlv1.GraphQLDeltaDeleteRequest]) (*connect.Response[emptypb.Empty], error)
GraphQLDeltaDelete deletes delta GraphQL entries
func (*GraphQLServiceRPC) GraphQLDeltaInsert ¶
func (s *GraphQLServiceRPC) GraphQLDeltaInsert(ctx context.Context, req *connect.Request[graphqlv1.GraphQLDeltaInsertRequest]) (*connect.Response[emptypb.Empty], error)
GraphQLDeltaInsert creates new delta GraphQL entries
func (*GraphQLServiceRPC) GraphQLDeltaSync ¶
func (s *GraphQLServiceRPC) GraphQLDeltaSync(ctx context.Context, req *connect.Request[emptypb.Empty], stream *connect.ServerStream[graphqlv1.GraphQLDeltaSyncResponse]) error
GraphQLDeltaSync streams delta GraphQL changes in real-time
func (*GraphQLServiceRPC) GraphQLDeltaUpdate ¶
func (s *GraphQLServiceRPC) GraphQLDeltaUpdate(ctx context.Context, req *connect.Request[graphqlv1.GraphQLDeltaUpdateRequest]) (*connect.Response[emptypb.Empty], error)
GraphQLDeltaUpdate updates existing delta GraphQL entries
func (*GraphQLServiceRPC) GraphQLDuplicate ¶
func (*GraphQLServiceRPC) GraphQLHeaderCollection ¶
func (*GraphQLServiceRPC) GraphQLHeaderDelete ¶
func (*GraphQLServiceRPC) GraphQLHeaderDeltaCollection ¶
func (s *GraphQLServiceRPC) GraphQLHeaderDeltaCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[graphqlv1.GraphQLHeaderDeltaCollectionResponse], error)
GraphQLHeaderDeltaCollection fetches all delta GraphQL headers for the user's workspaces
func (*GraphQLServiceRPC) GraphQLHeaderDeltaDelete ¶
func (s *GraphQLServiceRPC) GraphQLHeaderDeltaDelete(ctx context.Context, req *connect.Request[graphqlv1.GraphQLHeaderDeltaDeleteRequest]) (*connect.Response[emptypb.Empty], error)
GraphQLHeaderDeltaDelete deletes delta GraphQL header entries
func (*GraphQLServiceRPC) GraphQLHeaderDeltaInsert ¶
func (s *GraphQLServiceRPC) GraphQLHeaderDeltaInsert(ctx context.Context, req *connect.Request[graphqlv1.GraphQLHeaderDeltaInsertRequest]) (*connect.Response[emptypb.Empty], error)
GraphQLHeaderDeltaInsert creates new delta GraphQL header entries
func (*GraphQLServiceRPC) GraphQLHeaderDeltaSync ¶
func (s *GraphQLServiceRPC) GraphQLHeaderDeltaSync(ctx context.Context, req *connect.Request[emptypb.Empty], stream *connect.ServerStream[graphqlv1.GraphQLHeaderDeltaSyncResponse]) error
GraphQLHeaderDeltaSync streams delta header changes to the client
func (*GraphQLServiceRPC) GraphQLHeaderDeltaUpdate ¶
func (s *GraphQLServiceRPC) GraphQLHeaderDeltaUpdate(ctx context.Context, req *connect.Request[graphqlv1.GraphQLHeaderDeltaUpdateRequest]) (*connect.Response[emptypb.Empty], error)
GraphQLHeaderDeltaUpdate updates existing delta GraphQL header entries
func (*GraphQLServiceRPC) GraphQLHeaderInsert ¶
func (*GraphQLServiceRPC) GraphQLHeaderSync ¶
func (s *GraphQLServiceRPC) GraphQLHeaderSync(ctx context.Context, req *connect.Request[emptypb.Empty], stream *connect.ServerStream[graphqlv1.GraphQLHeaderSyncResponse]) error
func (*GraphQLServiceRPC) GraphQLHeaderUpdate ¶
func (*GraphQLServiceRPC) GraphQLInsert ¶
func (*GraphQLServiceRPC) GraphQLIntrospect ¶
func (s *GraphQLServiceRPC) GraphQLIntrospect(ctx context.Context, req *connect.Request[graphqlv1.GraphQLIntrospectRequest]) (*connect.Response[graphqlv1.GraphQLIntrospectResponse], error)
func (*GraphQLServiceRPC) GraphQLResponseAssertCollection ¶
func (*GraphQLServiceRPC) GraphQLResponseAssertSync ¶
func (s *GraphQLServiceRPC) GraphQLResponseAssertSync(ctx context.Context, req *connect.Request[emptypb.Empty], stream *connect.ServerStream[graphqlv1.GraphQLResponseAssertSyncResponse]) error
func (*GraphQLServiceRPC) GraphQLResponseCollection ¶
func (*GraphQLServiceRPC) GraphQLResponseHeaderCollection ¶
func (*GraphQLServiceRPC) GraphQLResponseHeaderSync ¶
func (s *GraphQLServiceRPC) GraphQLResponseHeaderSync(ctx context.Context, req *connect.Request[emptypb.Empty], stream *connect.ServerStream[graphqlv1.GraphQLResponseHeaderSyncResponse]) error
func (*GraphQLServiceRPC) GraphQLResponseSync ¶
func (s *GraphQLServiceRPC) GraphQLResponseSync(ctx context.Context, req *connect.Request[emptypb.Empty], stream *connect.ServerStream[graphqlv1.GraphQLResponseSyncResponse]) error
func (*GraphQLServiceRPC) GraphQLRun ¶
func (*GraphQLServiceRPC) GraphQLSync ¶
func (s *GraphQLServiceRPC) GraphQLSync(ctx context.Context, req *connect.Request[emptypb.Empty], stream *connect.ServerStream[graphqlv1.GraphQLSyncResponse]) error
func (*GraphQLServiceRPC) GraphQLUpdate ¶
func (*GraphQLServiceRPC) GraphQLVersionCollection ¶
func (*GraphQLServiceRPC) GraphQLVersionSync ¶
func (s *GraphQLServiceRPC) GraphQLVersionSync(ctx context.Context, req *connect.Request[emptypb.Empty], stream *connect.ServerStream[graphqlv1.GraphQLVersionSyncResponse]) error
type GraphQLServiceRPCDeps ¶
type GraphQLServiceRPCDeps struct {
DB *sql.DB
Services GraphQLServiceRPCServices
Readers GraphQLServiceRPCReaders
Resolver GraphQLResolver
Streamers *GraphQLStreamers
}
func (*GraphQLServiceRPCDeps) Validate ¶
func (d *GraphQLServiceRPCDeps) Validate() error
type GraphQLServiceRPCReaders ¶
type GraphQLServiceRPCReaders struct {
GraphQL *sgraphql.Reader
User *sworkspace.UserReader
Workspace *sworkspace.WorkspaceReader
}
type GraphQLServiceRPCServices ¶
type GraphQLServiceRPCServices struct {
GraphQL sgraphql.GraphQLService
Header sgraphql.GraphQLHeaderService
GraphQLAssert sgraphql.GraphQLAssertService
Response sgraphql.GraphQLResponseService
User suser.UserService
Workspace sworkspace.WorkspaceService
WorkspaceUser sworkspace.UserService
Env senv.EnvService
Variable senv.VariableService
File *sfile.FileService
}
type GraphQLStreamers ¶
type GraphQLStreamers struct {
GraphQL eventstream.SyncStreamer[GraphQLTopic, GraphQLEvent]
GraphQLHeader eventstream.SyncStreamer[GraphQLHeaderTopic, GraphQLHeaderEvent]
GraphQLAssert eventstream.SyncStreamer[GraphQLAssertTopic, GraphQLAssertEvent]
GraphQLResponse eventstream.SyncStreamer[GraphQLResponseTopic, GraphQLResponseEvent]
GraphQLResponseHeader eventstream.SyncStreamer[GraphQLResponseHeaderTopic, GraphQLResponseHeaderEvent]
GraphQLResponseAssert eventstream.SyncStreamer[GraphQLResponseAssertTopic, GraphQLResponseAssertEvent]
GraphQLVersion eventstream.SyncStreamer[GraphQLVersionTopic, GraphQLVersionEvent]
File eventstream.SyncStreamer[rfile.FileTopic, rfile.FileEvent]
}
GraphQLStreamers groups all event streams
type GraphQLTopic ¶
type GraphQLVersionEvent ¶
type GraphQLVersionEvent struct {
Type string
GraphQLVersion *graphqlv1.GraphQLVersion
}