Documentation
¶
Overview ¶
Package logging is the service's log: JSON lines on one stream, in the keys Cloud Logging reads, held to the table of events in events.go.
Every line goes through guard, which writes only what the table allows. So the rule that the log carries no direct identifier, IP address, work, reading or hint text (R09 spec; privacy 4 spec) does not rest on each line's author remembering it: a field the table does not give the event is dropped and counted, and an event the table does not know loses its message. The libraries in the process — tutor, module-kit and the rest — are handed this same *slog.Logger, and their lines pass the same guard.
Index ¶
Constants ¶
const ( // EventStartup is the line that says a revision has started, and which // build it runs. The delivery finds a revision's release by it. EventStartup = "startup" // EventStopping is the line that says a stop was asked for. EventStopping = "stopping" // EventStopped is the line that says the server has drained. EventStopped = "stopped" // EventShutdown is the last line of a process that stopped as asked. EventShutdown = "shutdown" // EventFailure is a failure nobody asked for, at a moment of the closed set // the field moment names, and in the daily job, at which of its steps. EventFailure = "failure" // EventPanic is a panic a handler raised and the server recovered. EventPanic = "panic" // EventMigrated is the line that says the migrations of a database ran: how many // it applied, the version the schema is at, and, for the rights', whether it // made the store and wrote the model. EventMigrated = "migrated" // EventRequest is the line of a request of the protocol: its method, its code, // the cause of a refusal, the class of a refused token, how long it ran and, // when it failed, the kind of the failure — never its body, headers, address // or an ID (R18, R33). The path of a Connect GET holds the message, so the // method is written, not the path. EventRequest = "request" // EventSwept is the line of a step of the daily job (R21): which step, how many // it did and failed, and whether it went to its end — counts alone, never an // ID of what it did them to. EventSwept = "swept" )
The events of the service's own lines.
const ( FieldVersion = "version" FieldCommit = "commit" FieldDate = "date" FieldPort = "port" FieldDeployed = "deployed" FieldStarted = "started" FieldCutShort = "cut_short" FieldMoment = "moment" FieldErrorKind = "error_kind" FieldPanicKind = "panic_kind" FieldApplied = "applied" FieldSchemaVersion = "schema_version" FieldDatabase = "database" FieldStoreCreated = "store_created" FieldModelWritten = "model_written" FieldMethod = "method" FieldCode = "code" FieldCause = "cause" FieldTokenClass = "token_class" FieldDurationMS = "duration_ms" FieldStep = "step" FieldDone = "done" FieldFailed = "failed" FieldFinished = "finished" )
The fields.
const ( MomentStartup = "startup" MomentServe = "serve" MomentShutdown = "shutdown" MomentMigrate = "migrate" MomentInvite = "invite" MomentCountries = "countries" MomentSweep = "sweep" )
The moments of a failure: the value set of FieldMoment.
const ( StepMarks = "marks" StepIdleAccounts = "idle_accounts" StepIdleProfiles = "idle_profiles" StepUsers = "users" StepTuples = "tuples" StepConsentRecords = "consent_records" StepKeys = "keys" StepChangelog = "changelog" )
The steps of the daily job: the value set of FieldStep.
const ( DatabaseAPI = "api" DatabaseOpenFGA = "openfga" )
The databases api migrates: the value set of FieldDatabase.
Variables ¶
var Codes = []string{
"ok", "canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found",
"already_exists", "permission_denied", "resource_exhausted", "failed_precondition",
"aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss",
"unauthenticated",
}
Codes is the value set of FieldCode: Connect's codes in Connect's words, and ok for a request that was not refused.
var Steps = []string{StepMarks, StepIdleAccounts, StepIdleProfiles, StepUsers, StepTuples, StepConsentRecords, StepKeys, StepChangelog}
Steps is every step of the daily job, in the order it takes them.
var TokenClasses = []string{"expired", "invalid", "revoked", "no_user", "disabled", "failed"}
TokenClasses is the value set of FieldTokenClass: the classes of a refused token, in authn's words (R20, R32).
Functions ¶
Types ¶
type Kind ¶
type Kind struct {
// contains filtered or unexported fields
}
Kind names what an error or a panic is, and none of what it carries: its text may hold a path, an address, a value from a request. Only ErrorKind and PanicKind make one, and the table accepts no other value for the fields error_kind and panic_kind.
func ErrorKind ¶
ErrorKind names an error by its chain, outermost first: the type of each link, a sentinel of the standard library by its name, and an errno of the system in the system's own words, which hold no data. The text of any other link is not written, since an error made by fmt.Errorf holds whatever its author formatted into it.
func PanicKind ¶
PanicKind names what a panic was raised with. A fault of the Go runtime is put in the runtime's own words, found inside whatever wrapped it, because those words hold types and numbers and no data. Anything else is a value of ours or a library's, which may hold a task, an answer or an image, so only its type is written.