The constraint exspressions syntax proposal was accepted.
This syntax model implies the equality operator by default, for example:
"foo" || "bar"
value equals "foo"
or value equals "bar"
package main | |
import ( | |
"log" | |
"net/http" | |
"github.com/valyala/fasthttp" | |
"github.com/arl/statsviz" | |
) |
# /etc/ggproxy/config.yaml | |
ingress: | |
# Address and port of the ingress server. | |
host: localhost:443 | |
# Optional, enables HTTPS. | |
tls: | |
# Certificate file path. | |
cert-file: ingress.cert |
This document briefly explains the rationale behind GQT, a GraphQL templating language specifically developed for GraphGuard, and why using native GraphQL for template definitions isn't a good idea in our opinion.
Arguments must have a value by spec, even when the value is useless in case of a template.
query {
foo(limit: 0 @constraint(OR: [{ge: 2, le: 10}]))
Code:
type T struct { p Int }
The following documents represent different options of representing the AST of the above code using a human-readable textual data format.
package blog | |
import "std" 1.0 { bytelen } | |
import "session" 1.0 { field as sessionField } | |
import "time" 1.0 { Time, now } | |
import "sys" 1.0 { env } | |
import "json" 1.0 { JSONValue } | |
import "github.com/sml/x/jwt" 1.0 { | |
parsed as jwtParsed |
// Types | |
type MessageBody String | |
type UserName String | |
type PasswordHash String | |
type ConversationTitle String | |
type ID [32]Byte | |
type alias UserID ID | |
type alias ConversationID ID |
// Events | |
event UserCreated { | |
id *User | |
name String | |
passwordHash String | |
} | |
event UserDeactivated { | |
user *User |
package main | |
import ( | |
"io" | |
"testing" | |
) | |
type MockReader struct { | |
Contents []byte | |
CurrentOffset int |
# exampleStreams demonstrates a service pushing real-time notification | |
# events to subscribers (server-side events) | |
# Clients may subscribe to the multicast through f:Root.subscription. | |
# Clients may also cancel their subscription through | |
# f:Root.subscriptionCancelation. | |
# disconnections will automatically cancel any subscriptions associated | |
# with the client. | |
# Stream topics will automatically be created by std::event on | |
# transaction commit and also automatically deleted when the last | |
# subscriber is gone |