Documentation
¶
Overview ¶
Package scriptnotify reads a managed script's platform.notify and platform.publish arguments into the notify tool call each one issues.
It holds only the reading: what each argument may be, and the payload it becomes. Issuing the call -- admission, the write barrier in a draft, the funnel every host call goes through, recording what was posted -- stays in internal/platform/scriptrun with the rest of the host. The two bindings' arguments grew past what that package's size budget had room for, and nothing in them needs a run.
Index ¶
Constants ¶
const Tool = "notify"
Tool is the platform tool both bindings issue. It is named here rather than imported from internal/platform/notifylayer because the host reaches every tool by name through one funnel and imports none of them.
Variables ¶
This section is empty.
Functions ¶
func Publish ¶
func Publish(b *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (map[string]any, error)
Publish reads platform.publish(channel, name, message="", key="", repeat_after="", access="", expires_in="", target="") into a notify action=publish call.
The asset is named the way platform.export named it when it wrote it, so a script that builds a report and publishes it says the same name twice rather than carrying an id between the two calls. access is who the posted link opens for (#2088); left out, the tool's default, signed_in, applies.
func Send ¶
func Send(b *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple, runLink string) (map[string]any, error)
Send reads platform.notify(channel, title, body="", link=<the run's page>, data=None, key="", repeat_after="", attachments=None, target="", reply_to="") into a notify action=send call.
reply_to is passed as the script gave it (#2903): the tool decides whether it is one plain address, so the recording a test asserts on holds the value the script sent, and a value a form visitor made unusable leaves the message sent with the reason in the answer rather than failing the run.
runLink is the run's own page. It is the link when the script names none, so every post from a scheduled script leads back to the run that produced it: a monitor that posts a number without saying where the number came from is the thing people mute. link=None or link="" sends no link (#2743): an email read by people with no account, such as a data file sent to a client's own mailboxes, has nothing to open.
Types ¶
This section is empty.