Documentation
¶
Index ¶
- type ACL
- type ACLInput
- type ACLValue
- type AccessKind
- type AccessScope
- type ActivitySubscription
- type ActivitySubscriptionCursor
- type ActivitySubscriptionValue
- type ByteRange
- type Cursor
- type Email
- type EmailCursor
- type EmailEvent
- type Entity
- type EntityValue
- type GeneralACL
- type Mailbox
- type MailingList
- type MailingListACL
- type MailingListACLCursor
- type MailingListCursor
- type MailingListEvent
- type MailingListInput
- type MailingListSubscription
- type MailingListWebhookInput
- type MailingListWebhookSubscription
- type OAuthClient
- type Patch
- type Patchset
- type PatchsetCursor
- type PatchsetEvent
- type PatchsetStatus
- type PatchsetTool
- type Thread
- type ThreadBlock
- type ThreadCursor
- type ToolIcon
- type URL
- type User
- func ListPatches(client *gqlclient.Client, ctx context.Context, username string, name string, ...) (user *User, err error)
- func MailingLists(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (me *User, err error)
- func MailingListsByUser(client *gqlclient.Client, ctx context.Context, username string, cursor *Cursor) (user *User, err error)
- 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 ACL ¶
type ACL struct { // Permission to browse or subscribe to emails Browse bool `json:"browse"` // Permission to reply to existing threads Reply bool `json:"reply"` // Permission to start new threads Post bool `json:"post"` // Permission to moderate the list Moderate bool `json:"moderate"` // Underlying value of the GraphQL interface Value ACLValue `json:"-"` }
func (*ACL) UnmarshalJSON ¶
type ACLValue ¶
type ACLValue interface {
// contains filtered or unexported methods
}
ACLValue is one of: MailingListACL | GeneralACL
type AccessKind ¶
type AccessKind string
const ( AccessKindRo AccessKind = "RO" AccessKindRw AccessKind = "RW" )
type AccessScope ¶
type AccessScope string
const ( AccessScopeAcls AccessScope = "ACLS" AccessScopeEmails AccessScope = "EMAILS" AccessScopeLists AccessScope = "LISTS" AccessScopePatches AccessScope = "PATCHES" AccessScopeProfile AccessScope = "PROFILE" AccessScopeSubscriptions AccessScope = "SUBSCRIPTIONS" )
type ActivitySubscription ¶
type ActivitySubscription struct { Id int32 `json:"id"` Created gqlclient.Time `json:"created"` // Underlying value of the GraphQL interface Value ActivitySubscriptionValue `json:"-"` }
func (*ActivitySubscription) UnmarshalJSON ¶
func (base *ActivitySubscription) UnmarshalJSON(b []byte) error
type ActivitySubscriptionCursor ¶
type ActivitySubscriptionCursor struct { Results []ActivitySubscription `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating 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.
type ActivitySubscriptionValue ¶
type ActivitySubscriptionValue interface {
// contains filtered or unexported methods
}
ActivitySubscriptionValue is one of: MailingListSubscription
type ByteRange ¶
type ByteRange struct { // Inclusive start byte offset. Start int32 `json:"start"` // Exclusive end byte offset. End int32 `json:"end"` }
A byte range.
type Email ¶
type Email struct { Id int32 `json:"id"` // The entity which sent this email. Will be a User if it can be associated // with an account, or a Mailbox otherwise. Sender *Entity `json:"sender"` // Time we received this email (non-forgable). Received gqlclient.Time `json:"received"` // Time given by Date header (forgable). Date gqlclient.Time `json:"date,omitempty"` // The Subject header. Subject string `json:"subject"` // The Message-ID header, without angle brackets. MessageID string `json:"messageID"` // The In-Reply-To header, if present, without angle brackets. InReplyTo *string `json:"inReplyTo,omitempty"` // Provides the value (or values) of a specific header from this email. Note // that the returned value is coerced to UTF-8 and may be lossy under certain // circumstances. Header []string `json:"header"` // Retrieves the value of an address list header, such as To or Cc. AddressList []Mailbox `json:"addressList"` // The decoded text/plain message part of the email, i.e. email body. Body string `json:"body"` // A URL from which the full raw message envelope may be downloaded. Envelope URL `json:"envelope"` Thread *Thread `json:"thread"` Parent *Email `json:"parent,omitempty"` Patch *Patch `json:"patch,omitempty"` Patchset *Patchset `json:"patchset,omitempty"` List *MailingList `json:"list"` }
type EmailCursor ¶
type EmailCursor struct { Results []Email `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating emails
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 EmailEvent ¶
type EmailEvent struct { Uuid string `json:"uuid"` Event WebhookEvent `json:"event"` Date gqlclient.Time `json:"date"` Email *Email `json:"email"` }
type Entity ¶
type Entity struct { 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 | Mailbox
type GeneralACL ¶
type GeneralACL struct { Browse bool `json:"browse"` Reply bool `json:"reply"` Post bool `json:"post"` Moderate bool `json:"moderate"` }
An ACL entry that applies "generally", for example the rights which apply to all subscribers to a list.
type Mailbox ¶
type Mailbox struct { CanonicalName string `json:"canonicalName"` Name string `json:"name"` Address string `json:"address"` }
A mailbox not associated with a registered user
type MailingList ¶
type MailingList struct { Id int32 `json:"id"` Created gqlclient.Time `json:"created"` Updated gqlclient.Time `json:"updated"` Name string `json:"name"` Owner *Entity `json:"owner"` Description *string `json:"description,omitempty"` Visibility Visibility `json:"visibility"` // List of globs for permitted or rejected mimetypes on this list // e.g. text/* PermitMime []string `json:"permitMime"` RejectMime []string `json:"rejectMime"` // List of threads on this list in order of most recently bumped Threads *ThreadCursor `json:"threads"` // List of emails received on this list in reverse chronological order Emails *EmailCursor `json:"emails"` // List of patches received on this list in order of most recently bumped Patches *PatchsetCursor `json:"patches"` // True if an import operation is underway for this list Importing bool `json:"importing"` // The access that applies to this user for this list Access *ACL `json:"access"` // The user's subscription for this list, if any Subscription *MailingListSubscription `json:"subscription,omitempty"` // URLs to application/mbox archives for this mailing list Archive URL `json:"archive"` Last30days URL `json:"last30days"` // Access control list entries for this mailing list Acl *MailingListACLCursor `json:"acl"` DefaultACL *GeneralACL `json:"defaultACL"` // Returns a list of mailing list webhook subscriptions. For clients // authenticated with a personal access token, this returns all webhooks // configured by all GraphQL clients for your account. For clients // authenticated with an OAuth 2.0 access token, this returns only webhooks // registered for your client. Webhooks *WebhookSubscriptionCursor `json:"webhooks"` // Returns details of a mailing list webhook subscription by its ID. Webhook *WebhookSubscription `json:"webhook,omitempty"` }
type MailingListACL ¶
type MailingListACL struct { Id int32 `json:"id"` Created gqlclient.Time `json:"created"` List *MailingList `json:"list"` Entity *Entity `json:"entity"` Browse bool `json:"browse"` Reply bool `json:"reply"` Post bool `json:"post"` Moderate bool `json:"moderate"` }
These ACLs are configured for specific entities, and may be used to expand or constrain the rights of a participant.
type MailingListACLCursor ¶
type MailingListACLCursor struct { Results []MailingListACL `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating ACL 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 MailingListCursor ¶
type MailingListCursor struct { Results []MailingList `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating mailing lists
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 MailingListEvent ¶
type MailingListEvent struct { Uuid string `json:"uuid"` Event WebhookEvent `json:"event"` Date gqlclient.Time `json:"date"` List *MailingList `json:"list"` }
type MailingListInput ¶
type MailingListInput struct { Description *string `json:"description,omitempty"` Visibility *Visibility `json:"visibility,omitempty"` // List of globs for permitted or rejected mimetypes on this list // e.g. text/* PermitMime []string `json:"permitMime,omitempty"` RejectMime []string `json:"rejectMime,omitempty"` }
type MailingListSubscription ¶
type MailingListSubscription struct { Id int32 `json:"id"` Created gqlclient.Time `json:"created"` List *MailingList `json:"list"` }
type MailingListWebhookInput ¶
type MailingListWebhookInput struct { Url string `json:"url"` Events []WebhookEvent `json:"events"` Query string `json:"query"` }
type MailingListWebhookSubscription ¶
type MailingListWebhookSubscription 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"` List *MailingList `json:"list"` }
type OAuthClient ¶
type OAuthClient struct {
Uuid string `json:"uuid"`
}
type Patch ¶
type Patch struct { Index *int32 `json:"index,omitempty"` Count *int32 `json:"count,omitempty"` Version *int32 `json:"version,omitempty"` Prefix *string `json:"prefix,omitempty"` Subject *string `json:"subject,omitempty"` }
Information parsed from the subject line of a patch, such that the following:
[PATCH myproject v2 3/4] Add foo to bar
Will produce:
index: 3 count: 4 version: 2 prefix: "myproject" subject: "Add foo to bar"
type Patchset ¶
type Patchset struct { Id int32 `json:"id"` Created gqlclient.Time `json:"created"` Updated gqlclient.Time `json:"updated"` Subject string `json:"subject"` Version int32 `json:"version"` Prefix *string `json:"prefix,omitempty"` Status PatchsetStatus `json:"status"` Submitter *Entity `json:"submitter"` CoverLetter *Email `json:"coverLetter,omitempty"` Thread *Thread `json:"thread"` SupersededBy *Patchset `json:"supersededBy,omitempty"` List *MailingList `json:"list"` Patches *EmailCursor `json:"patches"` Tools []PatchsetTool `json:"tools"` // URL to an application/mbox archive of only the patches in this thread Mbox URL `json:"mbox"` }
func UpdatePatchset ¶
type PatchsetCursor ¶
type PatchsetCursor struct { Results []Patchset `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating patchsets
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 PatchsetEvent ¶
type PatchsetEvent struct { Uuid string `json:"uuid"` Event WebhookEvent `json:"event"` Date gqlclient.Time `json:"date"` Patchset *Patchset `json:"patchset"` }
type PatchsetStatus ¶
type PatchsetStatus string
const ( PatchsetStatusUnknown PatchsetStatus = "UNKNOWN" PatchsetStatusProposed PatchsetStatus = "PROPOSED" PatchsetStatusNeedsRevision PatchsetStatus = "NEEDS_REVISION" PatchsetStatusSuperseded PatchsetStatus = "SUPERSEDED" PatchsetStatusApproved PatchsetStatus = "APPROVED" PatchsetStatusRejected PatchsetStatus = "REJECTED" PatchsetStatusApplied PatchsetStatus = "APPLIED" )
type PatchsetTool ¶
type PatchsetTool struct { Id int32 `json:"id"` Created gqlclient.Time `json:"created"` Updated gqlclient.Time `json:"updated"` Icon ToolIcon `json:"icon"` Details string `json:"details"` Patchset *Patchset `json:"patchset"` }
Used to add some kind of indicator for a third-party process associated with a patchset, such as a CI service validating the change.
type Thread ¶
type Thread struct { Created gqlclient.Time `json:"created"` Updated gqlclient.Time `json:"updated"` Subject string `json:"subject"` Replies int32 `json:"replies"` Participants int32 `json:"participants"` Sender *Entity `json:"sender"` Root *Email `json:"root"` List *MailingList `json:"list"` // Replies to this thread, in chronological order Descendants *EmailCursor `json:"descendants"` // A mailto: URI for replying to the latest message in this thread Mailto string `json:"mailto"` // URL to an application/mbox archive of this thread Mbox URL `json:"mbox"` // Thread parsed as a tree. // // The returned list is never empty. The first item is guaranteed to be the root // message. The blocks are sorted in topological order. Blocks []ThreadBlock `json:"blocks"` }
type ThreadBlock ¶
type ThreadBlock struct { // Unique identifier for this block. Key string `json:"key"` // The block's plain-text content. Body string `json:"body"` // Index of the parent block (if any) in Thread.blocks. Parent *int32 `json:"parent,omitempty"` // Replies to this block. // // The list items are indexes into Thread.blocks. Children []int32 `json:"children"` // The email this block comes from. Source *Email `json:"source"` // The range of this block in the source email body. SourceRange *ByteRange `json:"sourceRange"` // If this block is a reply to a particular chunk of the parent block, this // field indicates the range of that chunk in the parent's email body. ParentRange *ByteRange `json:"parentRange,omitempty"` }
A block of text in an email thread.
Blocks are parts of a message's body that aren't quotes of the parent message. A block can be a reply to a parent block, in which case the parentStart and parentEnd fields indicate which part of the parent message is replied to. A block can have replies, each of which will be represented by a block in the children field.
type ThreadCursor ¶
type ThreadCursor struct { Results []Thread `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating threads
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 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 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"` List *MailingList `json:"list,omitempty"` Lists *MailingListCursor `json:"lists"` Emails *EmailCursor `json:"emails"` Threads *ThreadCursor `json:"threads"` Patches *PatchsetCursor `json:"patches"` }
A registered user
func ListPatches ¶
func MailingLists ¶
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 Visibility ¶
type Visibility string
const ( VisibilityPublic Visibility = "PUBLIC" VisibilityUnlisted Visibility = "UNLISTED" VisibilityPrivate Visibility = "PRIVATE" )
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 ( WebhookEventListCreated WebhookEvent = "LIST_CREATED" WebhookEventListUpdated WebhookEvent = "LIST_UPDATED" WebhookEventListDeleted WebhookEvent = "LIST_DELETED" WebhookEventEmailReceived WebhookEvent = "EMAIL_RECEIVED" WebhookEventPatchsetReceived WebhookEvent = "PATCHSET_RECEIVED" )
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: MailingListEvent | EmailEvent | PatchsetEvent
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 (*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.
type WebhookSubscriptionValue ¶
type WebhookSubscriptionValue interface {
// contains filtered or unexported methods
}
WebhookSubscriptionValue is one of: UserWebhookSubscription | MailingListWebhookSubscription