This gist is associated with the blog post "Building safe-by-default tools in our Go web application".
It contains the gorm hooks that we use to ensure our queries are correctly scoped.
| package copilot | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "reflect" | |
| "sync" | |
| "github.com/incident-io/core/server/lib/errors" | |
| "github.com/incident-io/core/server/lib/log" |
| import "./styles.css"; | |
| import { | |
| useForm, | |
| FormProvider, | |
| useController, | |
| useFormContext | |
| } from "react-hook-form"; | |
| import React, { useState } from "react"; | |
| import ReactAsyncSelect from "react-select/async"; |
| package errors | |
| import "context" | |
| // ErrorWithUrgency represents an error with a specified urgency. We currently | |
| // support two urgencies: | |
| // page - this means we will escalate to the on-call engineer. This is the default behaviour. | |
| // sentry - this means we will send it to Sentry, but won't page someone. | |
| type ErrorWithUrgency struct { | |
| cause error |
| package mw | |
| import ( | |
| "context" | |
| "reflect" | |
| "github.com/incident-io/core/server/api/gen/billing" | |
| "github.com/incident-io/core/server/api/gen/insights" | |
| "github.com/incident-io/core/server/api/gen/system" | |
| "github.com/incident-io/core/server/api/gen/typeaheads" |
| { | |
| "content": [ | |
| { | |
| "text": "Long Text", | |
| "style": "h1", | |
| "margin": [ | |
| 5, | |
| 5, | |
| 5, | |
| 20 |
| { | |
| "content": [ | |
| { | |
| "text": "Long Text", | |
| "style": "h1", | |
| "margin": [ | |
| 5, | |
| 5, | |
| 5, | |
| 20 |