Documentation
¶
Overview ¶
Package scriptpending keeps a managed-script create the save gate refused (#2114): its source and the rest of what the create named, one per owner and name, so the author fixes a failing test or a lint finding with a small patch rather than sending a 45 KB script again. A successful save of the name removes it, and the next refused create of the same name replaces it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Create ¶
type Create struct {
Name string `json:"name"`
DisplayName string `json:"display_name,omitempty"`
Description string `json:"description,omitempty"`
Category *string `json:"category,omitempty"`
Params []script.Param `json:"params,omitempty"`
Tags []string `json:"tags,omitempty"`
Source string `json:"-"`
UpdatedAt time.Time `json:"-"`
}
Create is a refused create as its author sent it.
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
Postgres keeps them in script_pending_creates.
func NewPostgres ¶
NewPostgres returns the store over db, or nil without one.
type Store ¶
type Store interface {
// Put keeps c as the owner's pending create of its name, replacing one.
Put(ctx context.Context, owner string, c Create) error
// Get returns the owner's pending create of name, or nil when none is kept.
Get(ctx context.Context, owner, name string) (*Create, error)
// Delete removes the owner's pending create of name, if any.
Delete(ctx context.Context, owner, name string) error
}
Store keeps the refused creates.
Click to show internal directories.
Click to hide internal directories.