webhook

package
v0.0.18-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Copyright (c) Huawei Technologies Co., Ltd. 2024. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) Huawei Technologies Co., Ltd. 2024. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) Huawei Technologies Co., Ltd. 2024. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) Huawei Technologies Co., Ltd. 2024. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) Huawei Technologies Co., Ltd. 2024. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadPayload

func ReadPayload(w http.ResponseWriter, r *http.Request) (*bytes.Buffer, error)

Types

type Attributes

type Attributes struct {
	Action          *string `json:"action,omitempty"`
	State           *string `json:"state,omitempty"`
	Number          *int    `json:"iid,omitempty"`
	CommentID       *string `json:"discussion_id,omitempty"`
	Comment         *string `json:"note,omitempty"`
	CommentCategory *string `json:"noteable_type,omitempty"`
}

type GitCodeAccessor

type GitCodeAccessor struct {
	Issues *IssueEvent
	PR     *PullRequestEvent
	Note   *NoteEvent
}

func (*GitCodeAccessor) GetAccessor

func (a *GitCodeAccessor) GetAccessor(w http.ResponseWriter, r *http.Request) (any, *bytes.Buffer, *string, *string, bool)

type GitCodeAuthentication

type GitCodeAuthentication struct {
	// contains filtered or unexported fields
}

func (*GitCodeAuthentication) Auth

func (*GitCodeAuthentication) GetEventGUID

func (a *GitCodeAuthentication) GetEventGUID() string

func (*GitCodeAuthentication) GetEventType

func (a *GitCodeAuthentication) GetEventType() string

func (*GitCodeAuthentication) GetPayload

func (a *GitCodeAuthentication) GetPayload() *bytes.Buffer

func (*GitCodeAuthentication) SetSignKey

func (a *GitCodeAuthentication) SetSignKey(token []byte) error

type IssueEvent

type IssueEvent struct {
	UUID        *string          `json:"uuid,omitempty"`
	EventType   *string          `json:"event_type,omitempty"`
	ObjectKind  *string          `json:"object_kind,omitempty"`
	ManualBuild *bool            `json:"manual_build,omitempty"`
	Attributes  *Attributes      `json:"object_attributes,omitempty"`
	User        *openapi.User    `json:"user,omitempty"`
	Assignees   []*openapi.User  `json:"assignees,omitempty"`
	Repository  *Project         `json:"project,omitempty"`
	Labels      []*openapi.Label `json:"labels,omitempty"`
	Issue       *IssuePart       `json:"issue,omitempty"`
}

func (*IssueEvent) GetAction

func (iss *IssueEvent) GetAction() *string

func (*IssueEvent) GetAuthor

func (iss *IssueEvent) GetAuthor() *string

func (*IssueEvent) GetBase

func (iss *IssueEvent) GetBase() *string

func (*IssueEvent) GetComment

func (iss *IssueEvent) GetComment() *string

func (*IssueEvent) GetCommenter

func (iss *IssueEvent) GetCommenter() *string

func (*IssueEvent) GetHead

func (iss *IssueEvent) GetHead() *string

func (*IssueEvent) GetHtmlURL

func (iss *IssueEvent) GetHtmlURL() *string

func (*IssueEvent) GetNumber

func (iss *IssueEvent) GetNumber() *string

func (*IssueEvent) GetOrg

func (iss *IssueEvent) GetOrg() *string

func (*IssueEvent) GetRepo

func (iss *IssueEvent) GetRepo() *string

func (*IssueEvent) GetState

func (iss *IssueEvent) GetState() *string

func (*IssueEvent) ListLabels

func (iss *IssueEvent) ListLabels() []*string

type IssuePart

type IssuePart struct {
	Action *string       `json:"action,omitempty"`
	State  *string       `json:"state,omitempty"`
	Number *int          `json:"iid,omitempty"`
	Author *openapi.User `json:"author,omitempty"`
}

type NoteEvent

type NoteEvent struct {
	UUID        *string          `json:"uuid,omitempty"`
	EventType   *string          `json:"event_type,omitempty"`
	ObjectKind  *string          `json:"object_kind,omitempty"`
	ManualBuild *bool            `json:"manual_build,omitempty"`
	Attributes  *Attributes      `json:"object_attributes,omitempty"`
	User        *openapi.User    `json:"user,omitempty"`
	Repository  *Project         `json:"project,omitempty"`
	Labels      []*openapi.Label `json:"labels,omitempty"`
	Issue       *IssuePart       `json:"issue,omitempty"`
	PR          *PRPart          `json:"merge_request,omitempty"`
}

func (*NoteEvent) GetAction

func (n *NoteEvent) GetAction() *string

func (*NoteEvent) GetAuthor

func (n *NoteEvent) GetAuthor() *string

func (*NoteEvent) GetBase

func (n *NoteEvent) GetBase() *string

func (*NoteEvent) GetComment

func (n *NoteEvent) GetComment() *string

func (*NoteEvent) GetCommenter

func (n *NoteEvent) GetCommenter() *string

func (*NoteEvent) GetHead

func (n *NoteEvent) GetHead() *string

func (*NoteEvent) GetHtmlURL

func (n *NoteEvent) GetHtmlURL() *string

func (*NoteEvent) GetNumber

func (n *NoteEvent) GetNumber() *string

func (*NoteEvent) GetOrg

func (n *NoteEvent) GetOrg() *string

func (*NoteEvent) GetRepo

func (n *NoteEvent) GetRepo() *string

func (*NoteEvent) GetState

func (n *NoteEvent) GetState() *string

func (*NoteEvent) ListLabels

func (n *NoteEvent) ListLabels() []*string

type PRPart

type PRPart struct {
	Action *string       `json:"action,omitempty"`
	State  *string       `json:"state,omitempty"`
	Number *int          `json:"iid,omitempty"`
	Author *openapi.User `json:"author,omitempty"`
}

type Project

type Project struct {
	Name      *string `json:"name,omitempty"`
	Namespace *string `json:"namespace,omitempty"`
	HTMLURL   *string `json:"web_url,omitempty"`
}

type PullRequestEvent

type PullRequestEvent struct {
	UUID        *string          `json:"uuid,omitempty"`
	EventType   *string          `json:"event_type,omitempty"`
	ObjectKind  *string          `json:"object_kind,omitempty"`
	ManualBuild *bool            `json:"manual_build,omitempty"`
	Attributes  *Attributes      `json:"object_attributes,omitempty"`
	User        *openapi.User    `json:"user,omitempty"`
	Repository  *Project         `json:"project,omitempty"`
	Labels      []*openapi.Label `json:"labels,omitempty"`
	PR          *PRPart          `json:"merge_request,omitempty"`
}

func (*PullRequestEvent) GetAction

func (pr *PullRequestEvent) GetAction() *string

func (*PullRequestEvent) GetAuthor

func (pr *PullRequestEvent) GetAuthor() *string

func (*PullRequestEvent) GetBase

func (pr *PullRequestEvent) GetBase() *string

func (*PullRequestEvent) GetComment

func (pr *PullRequestEvent) GetComment() *string

func (*PullRequestEvent) GetCommenter

func (pr *PullRequestEvent) GetCommenter() *string

func (*PullRequestEvent) GetHead

func (pr *PullRequestEvent) GetHead() *string

func (*PullRequestEvent) GetHtmlURL

func (pr *PullRequestEvent) GetHtmlURL() *string

func (*PullRequestEvent) GetNumber

func (pr *PullRequestEvent) GetNumber() *string

func (*PullRequestEvent) GetOrg

func (pr *PullRequestEvent) GetOrg() *string

func (*PullRequestEvent) GetRepo

func (pr *PullRequestEvent) GetRepo() *string

func (*PullRequestEvent) GetState

func (pr *PullRequestEvent) GetState() *string

func (*PullRequestEvent) ListLabels

func (pr *PullRequestEvent) ListLabels() []*string

Jump to

Keyboard shortcuts

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