Documentation
¶
Index ¶
- type ACL
- type ACLCursor
- type AccessKind
- type AccessMode
- type AccessScope
- type Artifact
- type ArtifactCursor
- type BinaryBlob
- type Blob
- type BlobValue
- type Commit
- type CommitCursor
- type Cursor
- type Entity
- type EntityValue
- type Features
- type Filter
- type GitEvent
- type GitEventInput
- type GitWebhookInput
- type GitWebhookSubscription
- type OAuthClient
- type Object
- type ObjectType
- type ObjectValue
- type Redirect
- type Reference
- type ReferenceCursor
- type RepoInput
- type Repository
- func ClearCustomReadme(client *gqlclient.Client, ctx context.Context, id int32) (updateRepository *Repository, err error)
- func ClearDescription(client *gqlclient.Client, ctx context.Context, id int32) (updateRepository *Repository, err error)
- func CreateRepository(client *gqlclient.Client, ctx context.Context, name string, ...) (createRepository *Repository, err error)
- func DeleteRepository(client *gqlclient.Client, ctx context.Context, id int32) (deleteRepository *Repository, err error)
- func UpdateRepository(client *gqlclient.Client, ctx context.Context, id int32, input RepoInput) (updateRepository *Repository, err error)
- type RepositoryCursor
- func CompleteRepositories(client *gqlclient.Client, ctx context.Context) (repositories *RepositoryCursor, err error)
- func ExportRepositories(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (repositories *RepositoryCursor, err error)
- func Repositories(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (repositories *RepositoryCursor, err error)
- type RepositoryEvent
- type Settings
- type Signature
- type Tag
- type TextBlob
- type Tree
- type TreeEntry
- type TreeEntryCursor
- type UpdatedRef
- type UpdatedRefInput
- type User
- func AclByRepoName(client *gqlclient.Client, ctx context.Context, name string, cursor *Cursor) (me *User, err error)
- func AclByUser(client *gqlclient.Client, ctx context.Context, username string, name string, ...) (user *User, err error)
- func CompleteCoMaintainers(client *gqlclient.Client, ctx context.Context, name string) (me *User, err error)
- func ExportRepository(client *gqlclient.Client, ctx context.Context, username string, name string) (user *User, err error)
- func ListArtifacts(client *gqlclient.Client, ctx context.Context, name string) (me *User, err error)
- func ListArtifactsByUser(client *gqlclient.Client, ctx context.Context, username string, name string) (user *User, err error)
- func RepositoriesByUser(client *gqlclient.Client, ctx context.Context, username string, cursor *Cursor) (user *User, err error)
- func RepositoryByName(client *gqlclient.Client, ctx context.Context, name string) (me *User, err error)
- func RepositoryByUser(client *gqlclient.Client, ctx context.Context, username string, name string) (user *User, err error)
- func RepositoryIDByName(client *gqlclient.Client, ctx context.Context, name string) (me *User, err error)
- func RepositoryIDByUser(client *gqlclient.Client, ctx context.Context, username string, name string) (user *User, err error)
- func RevsByRepoName(client *gqlclient.Client, ctx context.Context, name string) (me *User, err error)
- func RevsByUser(client *gqlclient.Client, ctx context.Context, username string, name string) (user *User, err error)
- type UserWebhookInput
- type UserWebhookSubscription
- type Version
- type Visibility
- type WebhookDelivery
- type WebhookDeliveryCursor
- type WebhookEvent
- type WebhookPayload
- type WebhookPayloadValue
- type WebhookSubscription
- func CreateGitWebhook(client *gqlclient.Client, ctx context.Context, config GitWebhookInput) (createGitWebhook *WebhookSubscription, err error)
- func CreateUserWebhook(client *gqlclient.Client, ctx context.Context, config UserWebhookInput) (createUserWebhook *WebhookSubscription, err error)
- func DeleteGitWebhook(client *gqlclient.Client, ctx context.Context, id int32) (deleteGitWebhook *WebhookSubscription, err error)
- func DeleteUserWebhook(client *gqlclient.Client, ctx context.Context, id int32) (deleteUserWebhook *WebhookSubscription, err error)
- 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 { Id int32 `json:"id"` Created gqlclient.Time `json:"created"` Repository *Repository `json:"repository"` Entity *Entity `json:"entity"` Mode *AccessMode `json:"mode,omitempty"` }
type ACLCursor ¶
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 AccessKind ¶
type AccessKind string
const ( AccessKindRo AccessKind = "RO" AccessKindRw AccessKind = "RW" )
type AccessMode ¶
type AccessMode string
const ( // Read-only AccessModeRo AccessMode = "RO" // Read/write AccessModeRw AccessMode = "RW" )
func ParseAccessMode ¶
func ParseAccessMode(s string) (AccessMode, error)
type AccessScope ¶
type AccessScope string
const ( AccessScopeProfile AccessScope = "PROFILE" AccessScopeRepositories AccessScope = "REPOSITORIES" AccessScopeObjects AccessScope = "OBJECTS" AccessScopeAcls AccessScope = "ACLS" )
type Artifact ¶
type Artifact struct { Id int32 `json:"id"` Created gqlclient.Time `json:"created"` Filename string `json:"filename"` Checksum string `json:"checksum"` Size int32 `json:"size"` Url string `json:"url"` }
Arbitrary file attached to a git repository
func DeleteArtifact ¶
type ArtifactCursor ¶
type ArtifactCursor struct { Results []Artifact `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating artifacts
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 BinaryBlob ¶
type BinaryBlob struct { Type ObjectType `json:"type"` Id string `json:"id"` ShortId string `json:"shortId"` Raw string `json:"raw"` Base64 string `json:"base64"` }
type Blob ¶
type Blob struct { Id string `json:"id"` // Underlying value of the GraphQL interface Value BlobValue `json:"-"` }
func (*Blob) UnmarshalJSON ¶
type BlobValue ¶
type BlobValue interface {
// contains filtered or unexported methods
}
BlobValue is one of: TextBlob | BinaryBlob
type Commit ¶
type Commit struct { Type ObjectType `json:"type"` Id string `json:"id"` ShortId string `json:"shortId"` Raw string `json:"raw"` Author *Signature `json:"author"` Committer *Signature `json:"committer"` Message string `json:"message"` Tree *Tree `json:"tree"` Parents []Commit `json:"parents"` Diff string `json:"diff"` }
type CommitCursor ¶
type CommitCursor struct { Results []Commit `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating commits
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 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"` // Returns a specific repository owned by the entity. Repository *Repository `json:"repository,omitempty"` // Returns a list of repositories owned by the entity. Repositories *RepositoryCursor `json:"repositories"` // 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 Features ¶
type Features struct {
Artifacts bool `json:"artifacts"`
}
Describes the status of optional features
type GitEvent ¶ added in v0.7.0
type GitEvent struct { Uuid string `json:"uuid"` Event WebhookEvent `json:"event"` Date gqlclient.Time `json:"date"` Repository *Repository `json:"repository"` Pusher *Entity `json:"pusher"` Updates []*UpdatedRef `json:"updates"` }
This event is used for pre-receive and post-receive git hooks.
type GitEventInput ¶ added in v0.7.0
type GitEventInput struct { RepositoryID int32 `json:"repositoryID"` Event WebhookEvent `json:"event"` Updates []*UpdatedRefInput `json:"updates"` }
type GitWebhookInput ¶ added in v0.7.0
type GitWebhookInput struct { RepositoryID int32 `json:"repositoryID"` Url string `json:"url"` Events []WebhookEvent `json:"events"` Query string `json:"query"` }
type GitWebhookSubscription ¶ added in v0.7.0
type GitWebhookSubscription 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 OAuthClient ¶
type OAuthClient struct {
Uuid string `json:"uuid"`
}
type Object ¶
type Object struct { Type ObjectType `json:"type"` Id string `json:"id"` ShortId string `json:"shortId"` // Raw git object, base64 encoded Raw string `json:"raw"` // Underlying value of the GraphQL interface Value ObjectValue `json:"-"` }
func (*Object) UnmarshalJSON ¶
type ObjectType ¶
type ObjectType string
const ( ObjectTypeCommit ObjectType = "COMMIT" ObjectTypeTree ObjectType = "TREE" ObjectTypeBlob ObjectType = "BLOB" ObjectTypeTag ObjectType = "TAG" )
type ObjectValue ¶
type ObjectValue interface {
// contains filtered or unexported methods
}
ObjectValue is one of: Commit | Tree | TextBlob | BinaryBlob | Tag
type Reference ¶
type Reference struct { Name string `json:"name"` Target string `json:"target"` Follow *Object `json:"follow,omitempty"` Artifacts *ArtifactCursor `json:"artifacts"` }
type ReferenceCursor ¶
type ReferenceCursor struct { Results []Reference `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating a list of references
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 (ReferenceCursor) Heads ¶
func (cursor ReferenceCursor) Heads() []string
func (ReferenceCursor) ReferencesByType ¶
func (cursor ReferenceCursor) ReferencesByType(refType string) []string
func (ReferenceCursor) Tags ¶
func (cursor ReferenceCursor) Tags() []string
type RepoInput ¶
type RepoInput struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` Visibility *Visibility `json:"visibility,omitempty"` // Updates the custom README associated with this repository. Note that the // provided HTML will be sanitized when displayed on the web; see // https://man.sr.ht/markdown/#post-processing Readme *string `json:"readme,omitempty"` // Updates the repository HEAD reference, which serves as the default branch. // Must be a valid branch name. HEAD *string `json:"HEAD,omitempty"` }
type Repository ¶
type Repository struct { Id int32 `json:"id"` Created gqlclient.Time `json:"created"` Updated gqlclient.Time `json:"updated"` Owner *Entity `json:"owner"` Name string `json:"name"` Description *string `json:"description,omitempty"` Visibility Visibility `json:"visibility"` // The repository's custom README, if set. // // NOTICE: This returns unsanitized HTML. It is the client's responsibility to // sanitize this for display on the web, if so desired. Readme *string `json:"readme,omitempty"` // The access that applies to this user for this repository Access AccessMode `json:"access"` Acls *ACLCursor `json:"acls"` Objects []*Object `json:"objects"` References *ReferenceCursor `json:"references"` // The HEAD reference for this repository (equivalent to the default branch) HEAD *Reference `json:"HEAD,omitempty"` // Returns a list of comments sorted by committer time (similar to `git log`'s // default ordering). // // If `from` is specified, it is interpreted as a revspec to start logging // from. A clever reader may notice that using commits[-1].from + "^" as the // from parameter is equivalent to passing the cursor to the next call. Log *CommitCursor `json:"log"` // Returns a tree entry for a given path, at the given revspec. Path *TreeEntry `json:"path,omitempty"` // Returns the commit for a given revspec. Revparse_single *Commit `json:"revparse_single,omitempty"` RepoPath string `json:"repoPath"` }
func ClearCustomReadme ¶
func ClearDescription ¶
func CreateRepository ¶
func CreateRepository(client *gqlclient.Client, ctx context.Context, name string, visibility Visibility, description *string, cloneUrl *string) (createRepository *Repository, err error)
func DeleteRepository ¶
func UpdateRepository ¶
type RepositoryCursor ¶
type RepositoryCursor struct { Results []Repository `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating a list of repositories
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 CompleteRepositories ¶
func ExportRepositories ¶
func Repositories ¶
type RepositoryEvent ¶
type RepositoryEvent struct { Uuid string `json:"uuid"` Event WebhookEvent `json:"event"` Date gqlclient.Time `json:"date"` Repository *Repository `json:"repository"` }
type TextBlob ¶
type TextBlob struct { Type ObjectType `json:"type"` Id string `json:"id"` ShortId string `json:"shortId"` Raw string `json:"raw"` Text string `json:"text"` }
type Tree ¶
type Tree struct { Type ObjectType `json:"type"` Id string `json:"id"` ShortId string `json:"shortId"` Raw string `json:"raw"` Entries *TreeEntryCursor `json:"entries"` Entry *TreeEntry `json:"entry,omitempty"` }
type TreeEntryCursor ¶
type TreeEntryCursor struct { Results []TreeEntry `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating tree 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 UpdatedRef ¶ added in v0.7.0
type UpdatedRef struct { Ref *Reference `json:"ref,omitempty"` Old *Object `json:"old,omitempty"` New *Object `json:"new,omitempty"` // Note: this only returns up to the most recent 50 commits included in the // update, i.e. old..new or new~50..new, whichever has fewer commits. Log *CommitCursor `json:"log,omitempty"` // Difference from old..new in the unified diff format. // // This field is null if the diff requires more than one second to prepare. Diff *string `json:"diff,omitempty"` }
type UpdatedRefInput ¶ added in v0.7.0
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"` Repository *Repository `json:"repository,omitempty"` Repositories *RepositoryCursor `json:"repositories"` }
func AclByRepoName ¶
func CompleteCoMaintainers ¶
func ExportRepository ¶
func ListArtifacts ¶
func ListArtifactsByUser ¶
func RepositoriesByUser ¶
func RepositoryByName ¶
func RepositoryByUser ¶
func RepositoryIDByName ¶
func RepositoryIDByUser ¶
func RevsByRepoName ¶
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"` // Optional features Features *Features `json:"features"` // Config settings Settings *Settings `json:"settings"` }
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 ¶
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 ( WebhookEventRepoCreated WebhookEvent = "REPO_CREATED" WebhookEventRepoUpdate WebhookEvent = "REPO_UPDATE" WebhookEventRepoDeleted WebhookEvent = "REPO_DELETED" WebhookEventGitPreReceive WebhookEvent = "GIT_PRE_RECEIVE" WebhookEventGitPostReceive WebhookEvent = "GIT_POST_RECEIVE" )
func ParseEvents ¶
func ParseEvents(events []string) ([]WebhookEvent, error)
func ParseGitWebhookEvents ¶ added in v0.7.0
func ParseGitWebhookEvents(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: RepositoryEvent | GitEvent
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 CreateGitWebhook ¶ added in v0.7.0
func CreateGitWebhook(client *gqlclient.Client, ctx context.Context, config GitWebhookInput) (createGitWebhook *WebhookSubscription, err error)
func CreateUserWebhook ¶
func CreateUserWebhook(client *gqlclient.Client, ctx context.Context, config UserWebhookInput) (createUserWebhook *WebhookSubscription, err error)
func DeleteGitWebhook ¶ added in v0.7.0
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 GitWebhooks ¶ added in v0.7.0
func UserWebhooks ¶
type WebhookSubscriptionValue ¶
type WebhookSubscriptionValue interface {
// contains filtered or unexported methods
}
WebhookSubscriptionValue is one of: UserWebhookSubscription | GitWebhookSubscription