pagessrht

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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"
)

type Cursor

type Cursor string

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 added in v0.4.0

func (base *Entity) UnmarshalJSON(b []byte) error

type EntityValue added in v0.4.0

type EntityValue interface {
	// contains filtered or unexported methods
}

EntityValue is one of: User

type FileConfig added in v0.2.0

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 added in v0.2.0

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 added in v0.2.0

type OAuthClient struct {
	Uuid string `json:"uuid"`
}

type Protocol

type Protocol string
const (
	ProtocolHttps  Protocol = "HTTPS"
	ProtocolGemini Protocol = "GEMINI"
)

func ParseProtocol

func ParseProtocol(s string) (Protocol, error)

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"`
}

A published website

func Publish

func Publish(client *gqlclient.Client, ctx context.Context, domain string, content gqlclient.Upload, protocol Protocol, subdirectory string, siteConfig SiteConfig) (publish *Site, err error)

func Unpublish

func Unpublish(client *gqlclient.Client, ctx context.Context, domain string, protocol Protocol) (unpublish *Site, err error)

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

type SiteCursor struct {
	Results []Site  `json:"results"`
	Cursor  *Cursor `json:"cursor,omitempty"`
}

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.

func Sites

func Sites(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (sites *SiteCursor, err error)

type SiteEvent added in v0.2.0

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 added in v0.2.0

type UserWebhookInput struct {
	Url    string         `json:"url"`
	Events []WebhookEvent `json:"events"`
	Query  string         `json:"query"`
}

type UserWebhookSubscription added in v0.2.0

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 added in v0.2.0

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 added in v0.2.0

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 added in v0.2.0

type WebhookEvent string
const (
	WebhookEventSitePublished   WebhookEvent = "SITE_PUBLISHED"
	WebhookEventSiteUnpublished WebhookEvent = "SITE_UNPUBLISHED"
)

func ParseEvents added in v0.2.0

func ParseEvents(events []string) ([]WebhookEvent, error)

type WebhookPayload added in v0.2.0

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 added in v0.4.0

func (base *WebhookPayload) UnmarshalJSON(b []byte) error

type WebhookPayloadValue added in v0.4.0

type WebhookPayloadValue interface {
	// contains filtered or unexported methods
}

WebhookPayloadValue is one of: SiteEvent

type WebhookSubscription added in v0.2.0

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 added in v0.2.0

func CreateUserWebhook(client *gqlclient.Client, ctx context.Context, config UserWebhookInput) (createUserWebhook *WebhookSubscription, err error)

func DeleteUserWebhook added in v0.2.0

func DeleteUserWebhook(client *gqlclient.Client, ctx context.Context, id int32) (deleteUserWebhook *WebhookSubscription, err error)

func (*WebhookSubscription) UnmarshalJSON added in v0.4.0

func (base *WebhookSubscription) UnmarshalJSON(b []byte) error

type WebhookSubscriptionCursor added in v0.2.0

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 added in v0.2.0

func UserWebhooks(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (userWebhooks *WebhookSubscriptionCursor, err error)

type WebhookSubscriptionValue added in v0.4.0

type WebhookSubscriptionValue interface {
	// contains filtered or unexported methods
}

WebhookSubscriptionValue is one of: UserWebhookSubscription

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL