Discover Packages
github.com/logsquaredn/discord-notification-resource
package
module
Version:
v0.0.0-...-6b4397c
Opens a new window with list of versions in this module.
Published: Apr 9, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
discord-notification-resource
A Concourse resource for webhook notifications in Discord. Written in Go.
Example
resource_types:
- name: discord-notification-resource
type: registry-image
source:
repository: logsquaredn/discord-notification-resource
tag: latest
resources:
- name: notify
type: discord-notification-resource
source:
...
jobs:
- name: some-job
plan:
...
- put: notify
params:
...
Source Configuration
Parameter
Required
Description
webhook_id
yes
the id of the webhook to post to see below (1)
token
yes
the token to use to authenticate when posting to the webhook see below (2)
(1) webhook_id
will be the second to last path parameter in the url copied from the Copy Webhook URL
button below
(2) token
will be the last path parameter in the url copied from the Copy Webhook URL
button below
Behavior
check
not implemented
in
not implemented
out
see discordgo.WebhookParams . Addtionally:
Parameter
Required
Description
wait
no
whether or not to wait on the response and gather version and metadata info from it. Default false
content_file
no
path to a file containing the content of the message. Overrides content
username_file
no
path to a file containing the username for the message. Overrides username
avatar_url_file
no
path to a file containing the url of the avatar for the message. Overrides avatar_url
Expand ▾
Collapse ▴
Documentation
¶
type Metadata struct {
Name string `json:"name"`
Value string `json:"value"`
}
Metadata is the object which is passed in array form to Concourse through stdout from /opt/resource/out and /opt/resource/in
to provide additional information about the Version
type OutRequest struct {
Source Source `json:"source"`
Params PutParams `json:"params"`
}
OutRequest is the JSON object that Concourse passes to /opt/resource/out through stdin
type OutResponse struct {
Version Version `json:"version"`
Metadata []Metadata `json:"metadata"`
}
OutResponse is the JSON object that we pass back to Concourse through stdout from /opt/resource/out
type PutParams struct {
discordgo .WebhookParams
ContentFile string `json:"content_file,omitempty"`
UsernameFile string `json:"username_file,omitempty"`
AvatarURLFile string `json:"avatar_url_file,omitempty"`
Wait bool `json:"wait,omitempty"`
}
PutParams are additional parameters that can be passed to this Concourse Resource Type during a put step
type Source struct {
WebhookID string `json:"webhook_id"`
Token string `json:"token"`
}
Source is the JSON (yaml) object configured under the resources array in a Concourse pipeline
type Version struct {
Message string `json:"message"`
}
Version is the JSON object that is passed to and from Concourse
Source Files
¶
Directories
¶
cmd
Click to show internal directories.
Click to hide internal directories.