Documentation ¶
Overview ¶
Copyright 2020 WILDCARD SA.
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. Created on 20/01/2021
Copyright 2020 WILDCARD SA.
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. Created on 20/01/2021
Index ¶
- func BuildPlayPayload(play *ci.Play, status ci.State, logger logr.Logger) error
- type Object
- type Payload
- type PlayPayload
- func (p *PlayPayload) DoSend(whs []Webhook) error
- func (p *PlayPayload) GetObjectNamespacedName() types.NamespacedName
- func (p *PlayPayload) GetStatus() ci.State
- func (p *PlayPayload) Send(URL string) error
- func (p *PlayPayload) SetObjectNamespacedName(namespacedName types.NamespacedName)
- func (p *PlayPayload) SetStatus(state ci.State)
- type Webhook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Object ¶
type Object struct { NamespacedName types.NamespacedName `json:"namespaced_name,omitempty"` Kind string `json:"kind,omitempty"` }
type Payload ¶
type Payload interface { // Send sends the event to a webhook address Send(string) error // DoSend loop on webhook address and call Send DoSend([]Webhook) error // GetStatus return the name of the object in Payload GetStatus() ci.State // SetStatus record the status in the Payload SetStatus(ci.State) // GetObjectName return the name of the object in Payload GetObjectNamespacedName() types.NamespacedName // SetObjectName record the status in the Payload SetObjectNamespacedName(name types.NamespacedName) }
type PlayPayload ¶
type PlayPayload struct { Object Object `json:"object,omitempty"` ProjectID int64 `json:"project_id,omitempty"` PipelineID int64 `json:"pipeline_id,omitempty"` RepoURL string `json:"repo_url,omitempty"` Commit ci.Commit `json:"ref,omitempty"` Stack ci.Stack `json:"stack,omitempty"` Status ci.State `json:"status,omitempty"` }
func (*PlayPayload) DoSend ¶
func (p *PlayPayload) DoSend(whs []Webhook) error
func (*PlayPayload) GetObjectNamespacedName ¶
func (p *PlayPayload) GetObjectNamespacedName() types.NamespacedName
GetObjectName returns the object name from payload
func (*PlayPayload) GetStatus ¶
func (p *PlayPayload) GetStatus() ci.State
GetStatus returns the play status from payload
func (*PlayPayload) Send ¶
func (p *PlayPayload) Send(URL string) error
func (*PlayPayload) SetObjectNamespacedName ¶
func (p *PlayPayload) SetObjectNamespacedName(namespacedName types.NamespacedName)
SetObjectName sets the object name in payload
func (*PlayPayload) SetStatus ¶
func (p *PlayPayload) SetStatus(state ci.State)
SetStatus sets the play status to payload