discord

package
v0.82.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

Discord Webhook Plugin

Send attestations to Discord using webhooks.

How to use it

  1. To get started, you need to register the plugin in your Chainloop organization.
$ chainloop integration registered add discord-webhook --name [my-registration] --opt webhook=[webhookURL]

optionally you can specify a custom username

$ chainloop integration registered add discord-webhook --name [my-registration] --opt webhook=[webhookURL] --opt username=[username]
  1. Attach the integration to your workflow.
chainloop integration attached add --workflow $WID --integration $IID

Registration Input Schema

Field Type Required Description
username string no Override the default username of the webhook
webhook string (uri) yes URL of the discord webhook
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/chainloop-dev/chainloop/app/controlplane/plugins/core/discord-webhook/v1/registration-request",
  "properties": {
    "webhook": {
      "type": "string",
      "format": "uri",
      "description": "URL of the discord webhook"
    },
    "username": {
      "type": "string",
      "minLength": 1,
      "description": "Override the default username of the webhook"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "webhook"
  ]
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(l log.Logger) (sdk.FanOut, error)

Types

type Integration

type Integration struct {
	*sdk.FanOutIntegration
}

func (*Integration) Attach

func (i *Integration) Attach(_ context.Context, _ *sdk.AttachmentRequest) (*sdk.AttachmentResponse, error)

Attachment is executed when to attach a registered instance of this integration to a specific workflow

func (*Integration) Execute

func (i *Integration) Execute(_ context.Context, req *sdk.ExecutionRequest) error

Execute will be instantiated when either an attestation or a material has been received It's up to the plugin builder to differentiate between inputs

func (*Integration) Register

func (i *Integration) Register(_ context.Context, req *sdk.RegistrationRequest) (*sdk.RegistrationResponse, error)

Register is executed when a operator wants to register a specific instance of this integration with their Chainloop organization

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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