Documentation
¶
Index ¶
- type ACL
- type ACLInput
- type ACLValue
- type AccessKind
- type AccessScope
- type Cursor
- type Entity
- type EntityValue
- type FileConfig
- type FileOptions
- type OAuthClient
- type Protocol
- type Site
- func Acls(client *gqlclient.Client, ctx context.Context, domain string, ...) (site *Site, err error)
- func Publish(client *gqlclient.Client, ctx context.Context, domain string, ...) (publish *Site, err error)
- func Unpublish(client *gqlclient.Client, ctx context.Context, domain string, ...) (unpublish *Site, err error)
- type SiteACL
- type SiteACLCursor
- type SiteConfig
- type SiteCursor
- type SiteEvent
- type User
- type UserWebhookInput
- type UserWebhookSubscription
- type Version
- type WebhookDelivery
- type WebhookDeliveryCursor
- type WebhookEvent
- type WebhookPayload
- type WebhookPayloadValue
- type WebhookSubscription
- type WebhookSubscriptionCursor
- type WebhookSubscriptionValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACL ¶ added in v0.7.0
type ACL struct {
// Permission to publish this site
Publish bool `json:"publish"`
// Underlying value of the GraphQL interface
Value ACLValue `json:"-"`
}
An access control list item.
func (*ACL) UnmarshalJSON ¶ added in v0.7.0
type ACLInput ¶ added in v0.7.0
type ACLInput struct {
// Permission to publish the site
Publish bool `json:"publish"`
}
type ACLValue ¶ added in v0.7.0
type ACLValue interface {
// contains filtered or unexported methods
}
ACLValue is one of: SiteACL
type AccessKind ¶
type AccessKind string
const ( AccessKindRo AccessKind = "RO" AccessKindRw AccessKind = "RW" )
type AccessScope ¶
type AccessScope string
const ( AccessScopeProfile AccessScope = "PROFILE" AccessScopeSites AccessScope = "SITES" AccessScopePages AccessScope = "PAGES" AccessScopeAcls AccessScope = "ACLS" )
type Entity ¶
type Entity struct {
Id int32 `json:"id"`
Created gqlclient.Time `json:"created"`
Updated gqlclient.Time `json:"updated"`
// The canonical name of this entity. For users, this is their username
// prefixed with '~'. Additional entity types will be supported in the future.
CanonicalName string `json:"canonicalName"`
// Underlying value of the GraphQL interface
Value EntityValue `json:"-"`
}
func (*Entity) UnmarshalJSON ¶
type EntityValue ¶
type EntityValue interface {
// contains filtered or unexported methods
}
EntityValue is one of: User
type FileConfig ¶
type FileConfig struct {
Glob string `json:"glob"`
Options FileOptions `json:"options"`
}
Provides a way to configure options for a set of files matching the glob pattern.
type FileOptions ¶
type FileOptions struct {
// Value of the Cache-Control header to be used when serving the file.
CacheControl *string `json:"cacheControl,omitempty"`
}
Options for a file being served.
type OAuthClient ¶
type OAuthClient struct {
Uuid string `json:"uuid"`
}
type Site ¶
type Site struct {
Id int32 `json:"id"`
Created gqlclient.Time `json:"created"`
Updated gqlclient.Time `json:"updated"`
// Domain name the site services
Domain string `json:"domain"`
// The site protocol
Protocol Protocol `json:"protocol"`
// SHA-256 checksum of the source tarball (uncompressed)
Version string `json:"version"`
// Path to the file to serve for 404 Not Found responses
NotFound *string `json:"notFound,omitempty"`
Acls *SiteACLCursor `json:"acls"`
}
A published website
type SiteACL ¶ added in v0.7.0
type SiteACL struct {
Id int32 `json:"id"`
Created gqlclient.Time `json:"created"`
Site *Site `json:"site"`
Entity *Entity `json:"entity"`
Publish bool `json:"publish"`
}
These ACLs are configured for specific sites, and may be used to expand or constrain the rights of a participant.
func DeleteSiteACL ¶ added in v0.7.0
type SiteACLCursor ¶ added in v0.7.0
type SiteACLCursor struct {
Results []SiteACL `json:"results"`
Cursor *Cursor `json:"cursor,omitempty"`
}
A cursor for enumerating access control list entries
If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.
type SiteConfig ¶
type SiteConfig struct {
// Path to the file to serve for 404 Not Found responses
NotFound *string `json:"notFound,omitempty"`
FileConfigs []FileConfig `json:"fileConfigs,omitempty"`
}
type SiteCursor ¶
A cursor for enumerating site entries
If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.
type SiteEvent ¶
type SiteEvent struct {
Uuid string `json:"uuid"`
Event WebhookEvent `json:"event"`
Date gqlclient.Time `json:"date"`
Site *Site `json:"site"`
}
type User ¶
type User struct {
Id int32 `json:"id"`
Created gqlclient.Time `json:"created"`
Updated gqlclient.Time `json:"updated"`
CanonicalName string `json:"canonicalName"`
Username string `json:"username"`
Email string `json:"email"`
Url *string `json:"url,omitempty"`
Location *string `json:"location,omitempty"`
Bio *string `json:"bio,omitempty"`
}
type UserWebhookInput ¶
type UserWebhookInput struct {
Url string `json:"url"`
Events []WebhookEvent `json:"events"`
Query string `json:"query"`
}
type UserWebhookSubscription ¶
type UserWebhookSubscription struct {
Id int32 `json:"id"`
Events []WebhookEvent `json:"events"`
Query string `json:"query"`
Url string `json:"url"`
Client *OAuthClient `json:"client,omitempty"`
Deliveries *WebhookDeliveryCursor `json:"deliveries"`
Sample string `json:"sample"`
}
type Version ¶
type Version struct {
Major int32 `json:"major"`
Minor int32 `json:"minor"`
Patch int32 `json:"patch"`
// If this API version is scheduled for deprecation, this is the date on which
// it will stop working; or null if this API version is not scheduled for
// deprecation.
DeprecationDate gqlclient.Time `json:"deprecationDate,omitempty"`
}
type WebhookDelivery ¶
type WebhookDelivery struct {
Uuid string `json:"uuid"`
Date gqlclient.Time `json:"date"`
Event WebhookEvent `json:"event"`
Subscription *WebhookSubscription `json:"subscription"`
RequestBody string `json:"requestBody"`
// These details are provided only after a response is received from the
// remote server. If a response is sent whose Content-Type is not text/*, or
// cannot be decoded as UTF-8, the response body will be null. It will be
// truncated after 64 KiB.
ResponseBody *string `json:"responseBody,omitempty"`
ResponseHeaders *string `json:"responseHeaders,omitempty"`
ResponseStatus *int32 `json:"responseStatus,omitempty"`
}
type WebhookDeliveryCursor ¶
type WebhookDeliveryCursor struct {
Results []WebhookDelivery `json:"results"`
Cursor *Cursor `json:"cursor,omitempty"`
}
A cursor for enumerating a list of webhook deliveries
If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.
type WebhookEvent ¶
type WebhookEvent string
const ( WebhookEventSitePublished WebhookEvent = "SITE_PUBLISHED" WebhookEventSiteUnpublished WebhookEvent = "SITE_UNPUBLISHED" )
func ParseEvents ¶
func ParseEvents(events []string) ([]WebhookEvent, error)
type WebhookPayload ¶
type WebhookPayload struct {
Uuid string `json:"uuid"`
Event WebhookEvent `json:"event"`
Date gqlclient.Time `json:"date"`
// Underlying value of the GraphQL interface
Value WebhookPayloadValue `json:"-"`
}
func (*WebhookPayload) UnmarshalJSON ¶
func (base *WebhookPayload) UnmarshalJSON(b []byte) error
type WebhookPayloadValue ¶
type WebhookPayloadValue interface {
// contains filtered or unexported methods
}
WebhookPayloadValue is one of: SiteEvent
type WebhookSubscription ¶
type WebhookSubscription struct {
Id int32 `json:"id"`
Events []WebhookEvent `json:"events"`
Query string `json:"query"`
Url string `json:"url"`
// If this webhook was registered by an authorized OAuth 2.0 client, this
// field is non-null.
Client *OAuthClient `json:"client,omitempty"`
// All deliveries which have been sent to this webhook.
Deliveries *WebhookDeliveryCursor `json:"deliveries"`
// Returns a sample payload for this subscription, for testing purposes
Sample string `json:"sample"`
// Underlying value of the GraphQL interface
Value WebhookSubscriptionValue `json:"-"`
}
func CreateUserWebhook ¶
func CreateUserWebhook(client *gqlclient.Client, ctx context.Context, config UserWebhookInput) (createUserWebhook *WebhookSubscription, err error)
func DeleteUserWebhook ¶
func (*WebhookSubscription) UnmarshalJSON ¶
func (base *WebhookSubscription) UnmarshalJSON(b []byte) error
type WebhookSubscriptionCursor ¶
type WebhookSubscriptionCursor struct {
Results []WebhookSubscription `json:"results"`
Cursor *Cursor `json:"cursor,omitempty"`
}
A cursor for enumerating a list of webhook subscriptions
If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.
func UserWebhooks ¶
type WebhookSubscriptionValue ¶
type WebhookSubscriptionValue interface {
// contains filtered or unexported methods
}
WebhookSubscriptionValue is one of: UserWebhookSubscription