Documentation ¶
Index ¶
Constants ¶
View Source
const (
// NamespaceDefault is the default namespace to isolate top-level data sets.
NamespaceDefault = "tg"
)
Variables ¶
View Source
var (
ErrNotFound = errors.New("app not found")
)
Common errors for App services.
Functions ¶
Types ¶
type App ¶
type App struct { BackendToken string `json:"backend_token"` Description string `json:"description"` Enabled bool `json:"enabled"` ID uint64 `json:"-"` InProduction bool `json:"in_production"` Name string `json:"name"` Token string `json:"token"` URL string `json:"url"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
App represents an Org owned data container.
func (*App) Limit ¶
Limit returns the desired rate limit for an Application varied by production state.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error wraps common App errors.
type QueryOptions ¶
type QueryOptions struct { Before time.Time BackendTokens []string Enabled *bool IDs []uint64 InProduction *bool Limit int Tokens []string }
QueryOptions are used to narrow down app queries.
type Service ¶
type Service interface { service.Lifecycle Put(namespace string, app *App) (*App, error) Query(namespace string, opts QueryOptions) (List, error) }
Service for app interactions.
func PostgresService ¶
PostgresService returns a Postgres based Service implementation.
type ServiceMiddleware ¶
ServiceMiddleware is a chainable behaviour modifier for Service.
func InstrumentServiceMiddleware ¶
func InstrumentServiceMiddleware( component, store string, errCount kitmetrics.Counter, opCount kitmetrics.Counter, opLatency *prometheus.HistogramVec, ) ServiceMiddleware
InstrumentServiceMiddleware observes key apsects of Service operations and exposes Prometheus metrics.
func LogServiceMiddleware ¶
func LogServiceMiddleware(logger log.Logger, store string) ServiceMiddleware
LogServiceMiddleware gien a Logger wraps the next Service with logging capabilities.
Click to show internal directories.
Click to hide internal directories.