Documentation ¶
Index ¶
- type AccessKind
- type AccessScope
- type Cursor
- type Entity
- type EntityValue
- type File
- type OAuthClient
- type Paste
- func CreatePaste(client *gqlclient.Client, ctx context.Context, files []gqlclient.Upload, ...) (create *Paste, err error)
- func Delete(client *gqlclient.Client, ctx context.Context, id string) (delete *Paste, err error)
- func PasteContentsByID(client *gqlclient.Client, ctx context.Context, id string) (paste *Paste, err error)
- func ShowPaste(client *gqlclient.Client, ctx context.Context, id string) (paste *Paste, err error)
- func Update(client *gqlclient.Client, ctx context.Context, id string, ...) (update *Paste, err error)
- type PasteCursor
- func PasteCompletionList(client *gqlclient.Client, ctx context.Context) (pastes *PasteCursor, err error)
- func PasteContents(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (pastes *PasteCursor, err error)
- func Pastes(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (pastes *PasteCursor, err error)
- type PasteEvent
- type URL
- type User
- type UserWebhookInput
- type UserWebhookSubscription
- type Version
- type Visibility
- 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 AccessKind ¶
type AccessKind string
const ( AccessKindRo AccessKind = "RO" AccessKindRw AccessKind = "RW" )
type AccessScope ¶
type AccessScope string
const ( AccessScopeProfile AccessScope = "PROFILE" AccessScopePastes AccessScope = "PASTES" )
type Entity ¶
type Entity struct { Id int32 `json:"id"` Created gqlclient.Time `json:"created"` // 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"` Pastes *PasteCursor `json:"pastes"` // Underlying value of the GraphQL interface Value EntityValue `json:"-"` }
func (*Entity) UnmarshalJSON ¶ added in v0.4.0
type EntityValue ¶ added in v0.4.0
type EntityValue interface {
// contains filtered or unexported methods
}
EntityValue is one of: User
type OAuthClient ¶ added in v0.2.0
type OAuthClient struct {
Uuid string `json:"uuid"`
}
type Paste ¶
type Paste struct { Id string `json:"id"` Created gqlclient.Time `json:"created"` Visibility Visibility `json:"visibility"` Files []File `json:"files"` User *Entity `json:"user"` }
func CreatePaste ¶
func PasteContentsByID ¶ added in v0.5.0
type PasteCursor ¶
type PasteCursor struct { Results []Paste `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating pastes
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 PasteCompletionList ¶
func PasteContents ¶ added in v0.2.0
type PasteEvent ¶ added in v0.2.0
type PasteEvent struct { Uuid string `json:"uuid"` Event WebhookEvent `json:"event"` Date gqlclient.Time `json:"date"` Paste *Paste `json:"paste"` }
type URL ¶
type URL string
URL from which some secondary data may be retrieved. You must provide the same Authentication header to this address as you did to the GraphQL resolver which provided it. The URL is not guaranteed to be consistent for an extended length of time; applications should submit a new GraphQL query each time they wish to access the data at the provided URL.
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 Visibility ¶
type Visibility string
const ( // Visible to everyone, listed on your profile VisibilityPublic Visibility = "PUBLIC" // Visible to everyone (if they know the URL), not listed on your profile VisibilityUnlisted Visibility = "UNLISTED" // Not visible to anyone except those explicitly added to the access list VisibilityPrivate Visibility = "PRIVATE" )
func ParseVisibility ¶
func ParseVisibility(s string) (Visibility, error)
func (Visibility) TermString ¶
func (visibility Visibility) TermString() string
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 ( WebhookEventPasteCreated WebhookEvent = "PASTE_CREATED" WebhookEventPasteUpdated WebhookEvent = "PASTE_UPDATED" WebhookEventPasteDeleted WebhookEvent = "PASTE_DELETED" )
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: PasteEvent
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 (*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
type WebhookSubscriptionValue ¶ added in v0.4.0
type WebhookSubscriptionValue interface {
// contains filtered or unexported methods
}
WebhookSubscriptionValue is one of: UserWebhookSubscription