Documentation
¶
Overview ¶
The debug report a user shares when asking for help: the setup summary of the install and the ends of its logs, shown to the user exactly as it will leave, uploaded to a paste service with every secret masked, and deleted again once its time is up. Where it goes is brought by the paste services registered
Index ¶
- type Bundle
- type Debug
- func (d *Debug) Collect(ctx context.Context, cfg *config.Config, lines int, alone bool) Bundle
- func (d *Debug) Delete(ctx context.Context, cfg *config.Config, addresses []string) []Deleted
- func (d *Debug) Fate(service Service) string
- func (d *Debug) Notice() string
- func (d *Debug) Ordered() []Service
- func (d *Debug) Pending() []Link
- func (d *Debug) Register(registrant Registrant)
- func (d *Debug) Share(ctx context.Context, cfg *config.Config, token string) (Shared, error)
- func (d *Debug) Sweep(ctx context.Context)
- func (d *Debug) Tend(ctx context.Context) error
- type Deleted
- type Link
- type Part
- type Registrant
- type Registry
- type Service
- type Shared
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bundle ¶
type Bundle struct {
// What a share names the report by, kept for a while after it was made
Token string
Parts []Part
Made time.Time
// Profile it is of
Profile string
}
A debug report as it will leave this computer: the report itself first, then each log shared whole, every secret in them masked
type Debug ¶
type Debug struct {
Registry
// contains filtered or unexported fields
}
The debug reports of this install: collecting one as it will leave, sharing it through the paste services, and the pastes kept to be deleted once their time is up
func (*Debug) Collect ¶
Collects the debug report of the profile of the settings, kept by its token for the share that uploads it exactly as the user read it: when and of what it is, the setup summary, the end of each log a feature keeps, lines of each as the log or the lines given say, the settings' count for none; and, unless the report alone is asked for, each log a feature shares whole, as much of its end as the settings say. Every part has every secret in it masked, the profile's own wherever they stand
func (*Debug) Delete ¶
Deletes the pastes at the addresses, each on the service it is of, and forgets them among the pastes kept: what came of each, in the order given
func (*Debug) Fate ¶
What becomes of a paste of the service once shared, in a sentence: deleted after the time set, or kept by the service for as long as it keeps them
func (*Debug) Notice ¶
What a user is told before a report leaves this computer: where it goes, what it may hold that no masking takes out, who can read it, and what becomes of it on each service it may go to
func (*Debug) Ordered ¶
Paste services in the order they are tried: those debug.services names in its order, then the rest in the order they are registered
func (*Debug) Register ¶
func (d *Debug) Register(registrant Registrant)
Adds a registrant. A registry nested in the host reaches it through Host
func (*Debug) Share ¶
Uploads the report collected under the token exactly as it was collected, each part to the first paste service that takes it, and keeps the pastes of the services that delete them to be deleted once the time the settings keep them passed. The report itself must go. A log shared whole that no service took is told among the failures
type Link ¶
type Link struct {
// Part of the report it holds, its address, and the service it is on
Title, Address, Service string
// When it is deleted, or when the service drops it where it can't be deleted. Zero for a paste kept for good
Until time.Time
// The paste is deleted when its time is up, rather than dropped by the service
Deletes bool
}
A paste a debug report was shared as
type Registrant ¶
type Registrant interface {
Services() []Service
}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) Host ¶
Host the registry is nested in, through which plugins reach the debug reports
func (*Registry) Register ¶
func (r *Registry) Register(registrant Registrant)
type Service ¶
type Service struct {
// Name debug.services orders it by, what a user calls it, and the site its pastes are on
Name, Title, Site string
// Most bytes one paste holds there, any for zero: a longer text goes to the next service
Most int
// How long the service keeps a paste asked to stay for the time given, nil for one that keeps it until it is deleted
Expiry func(keep time.Duration) time.Duration
// Uploads the text, asked to stay for the time given where the service takes that, and gives the address of the paste
Upload func(ctx context.Context, client *http.Client, text string, keep time.Duration) (string, error)
// Deletes the paste at the address. nil for a service whose pastes can't be deleted, which stay as long as it keeps them
Delete func(ctx context.Context, client *http.Client, address string) error
// Whether the address is of a paste of the service
Owns func(address string) bool
}
A paste service a debug report is shared through, such as paste.rs