schema

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package schema has the webhooks: what each is, by its serial number, the session its calls are for, and its description

Index

Constants

View Source
const (
	CallAccepted = "accepted" // kept, as it was verified, when its webhook has a secret, and decoded
	CallRefused  = "refused"  // kept, with why it was refused
)

The statuses of calls, which they're listed by

View Source
const (
	SignatureGood = "good" // with the webhook's secret
	SignatureBad  = "bad"  // with a secret which isn't the webhook's
	SignatureNone = "none" // not signed
)

How a test call is signed

Variables

This section is empty.

Functions

func HideToken added in v1.7.5

func HideToken(text string) string

HideToken returns the text, with {token} in the place of the tokens of webhooks' URLs, as whoever has one can call its webhook. A token which isn't in a URL isn't known to be one.

Types

type Call

type Call struct {
	ID       uint64            `json:"id" readonly:"" help:"Serial number of the call"`
	Webhook  uint64            `json:"webhook" readonly:"" help:"Serial number of the webhook which was called"`
	Received time.Time         `json:"received" readonly:"" help:"When it was received"`
	Method   string            `json:"method" readonly:"" help:"Its HTTP method, such as POST, or GET" example:"POST"`
	Query    url.Values        `json:"query,omitempty" readonly:"" help:"Its query parameters"`
	Headers  map[string]string `` /* 239-byte string literal not displayed */
	Values   json.RawMessage   `` /* 147-byte string literal not displayed */
	Event    string            `` /* 127-byte string literal not displayed */
	Delivery string            `` /* 142-byte string literal not displayed */
	Verified bool              `json:"verified" readonly:"" help:"Whether its signature was verified, with the webhook's secret"`
	Test     bool              `json:"test,omitempty" readonly:"" help:"Whether it's a test call, which no service sent"`
	Error    string            `` /* 176-byte string literal not displayed */
	Body     []byte            `json:"body,omitempty" readonly:"" help:"Its body, as it was sent, up to a limit, which a signature is checked against"`
}

Call is a call of a webhook, by a service, which is kept, as it was received: its method, its query, the headers which say what it is, such as its event, delivery and signature, its body, as JSON values, and its body, as it was sent, which a signature is checked against, and what its protocol says it is, whether it was verified, or is a test, and why it was refused, when it was

func (Call) Cell

func (c Call) Cell(col int) tui.CellText

Cell returns the call's serial number, its webhook's, when it was received, in local time, its method, what happened, and whether it was accepted, or refused, with why

func (Call) Header

func (Call) Header() []string

func (Call) Status

func (c Call) Status() string

Status returns whether the call was accepted, or refused

func (Call) String

func (c Call) String() string

func (Call) Width

func (Call) Width(int) int

type CallList

type CallList struct {
	CallListRequest
	Count uint   `json:"count" help:"How many calls there are after the call, and since the time"`
	Body  []Call `json:"body,omitzero" help:"The calls"`
}

CallList is the calls which are listed, oldest first, or newest, and how many there are after the call, and since the time

func (CallList) String

func (l CallList) String() string

type CallListRequest

type CallListRequest struct {
	Webhook uint64    `json:"webhook,omitempty" help:"Serial number of the webhook whose calls are listed" optional:""`
	Session string    `json:"session,omitempty" help:"Identifier of the session whose webhooks' calls are listed" optional:""`
	After   uint64    `` /* 126-byte string literal not displayed */
	Status  string    `` /* 134-byte string literal not displayed */
	Since   time.Time `` /* 142-byte string literal not displayed */
	Newest  bool      `json:"newest,omitempty" help:"Whether the newest are listed first, rather than the oldest" optional:""`
	Limit   *uint64   `json:"limit,omitempty" help:"Most calls to return" optional:""`
}

CallListRequest is which calls are listed: those of the webhook, or the session's webhooks, when there's one, those which were accepted, or refused, or both, after the call with the serial number, and received since the time, oldest first, or newest, and at most the limit of them

func (CallListRequest) Query

func (r CallListRequest) Query() url.Values

Query returns the request as query parameters

type HookResponse

type HookResponse struct {
	Call      uint64 `json:"call,omitempty" help:"Serial number of the call, which was kept"`
	Duplicate bool   `json:"duplicate,omitempty" help:"Whether it was a delivery which was sent again, which wasn't kept again"`
}

HookResponse is the response to a call of a webhook's URL, which was kept, or was a delivery which was sent again

type TestRequest added in v1.7.4

type TestRequest struct {
	Webhook   uint64 `json:"webhook" help:"Serial number of the webhook"`
	Signature string `` /* 247-byte string literal not displayed */
}

TestRequest is the webhook which a test call is made to, and how it's signed

type Webhook

type Webhook struct {
	ID uint64 `json:"id" readonly:"" help:"Serial number of the webhook"`
	WebhookMeta
	HasSecret bool      `json:"has_secret" readonly:"" help:"Whether it has a secret, which its calls are verified with"`
	Created   time.Time `json:"created,omitzero" readonly:"" help:"When it was registered"`
}

Webhook is a webhook, its serial number, when it was registered, and whether it has a secret, which isn't returned

func (Webhook) Cell

func (w Webhook) Cell(col int) tui.CellText

Cell returns the webhook's serial number, type, description, session, whether it has a secret, and when it was created, in local time

func (Webhook) Header

func (Webhook) Header() []string

func (Webhook) String

func (w Webhook) String() string

func (Webhook) Width

func (Webhook) Width(int) int

type WebhookList

type WebhookList struct {
	WebhookListRequest
	Count uint      `json:"count" help:"How many webhooks there are"`
	Body  []Webhook `json:"body,omitzero" help:"The webhooks"`
}

WebhookList is the webhooks which are listed, newest first, and how many there are

func (WebhookList) String

func (l WebhookList) String() string

type WebhookListRequest

type WebhookListRequest struct {
	Session string  `json:"session,omitempty" help:"Identifier of the session whose webhooks are listed, or every webhook" optional:""`
	Offset  uint64  `json:"offset,omitempty" help:"How many webhooks to skip" optional:""`
	Limit   *uint64 `json:"limit,omitempty" help:"Most webhooks to return" optional:""`
}

WebhookListRequest is which webhooks are listed: those of the session, when there is one, from the offset, and at most the limit of them

func (WebhookListRequest) Query

func (r WebhookListRequest) Query() url.Values

Query returns the request as query parameters

type WebhookMeta

type WebhookMeta struct {
	Session     uuid.UUID `json:"session" help:"Session which the webhook's calls are for"`
	Description string    `` /* 149-byte string literal not displayed */
	Type        string    `` /* 199-byte string literal not displayed */
	Secret      string    `` /* 167-byte string literal not displayed */
}

WebhookMeta is what a webhook is for, which is set when it's registered: the session its calls are for, its description, the protocol of the service which calls it, and the secret which the service signs its calls with, when it does

type WebhookRequest

type WebhookRequest struct {
	Description *string `json:"description,omitempty" help:"What the webhook is for" optional:""`
	Secret      *string `json:"secret,omitempty" writeonly:"" help:"Secret which the service signs its calls with, or empty, to remove it" optional:""`
}

WebhookRequest is a change to a webhook: what's set is changed, such as its secret, which the service gives, once it's registered there, and an empty secret removes it

type WebhookToken

type WebhookToken struct {
	Webhook
	Token string `json:"token" readonly:"" help:"Token of the URL its service calls, which isn't returned again"`
	URL   string `` /* 173-byte string literal not displayed */
}

WebhookToken is a webhook which was registered, and its token, which is in the URL its service calls, which is only returned now, as it isn't kept

func (WebhookToken) String

func (w WebhookToken) String() string

Jump to

Keyboard shortcuts

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