package
1.0.0-rc.5
Repository: https://github.com/beneath-hq/beneath.git
Documentation: pkg.go.dev

# README

models/

This folder contains structs for database models and bus events. It also contains simple implementation code, e.g. for validation or for adhering to interfaces, but it should not contain complex functionality (certainly not code that calls services or infrastructure).

bus.Bus marshals async events with msgpack, so every struct used in events should have sensible msgpack struct tags (eg. use msgpack:"-" for sub-objects like database relationships).

Adding and running migrations

When you add or change a model, add related migrations to migrations/. Currently, migrations run automatically when you start the control server.

Database library

We use go-pg for mapping structs to the Postgres database (in infra/db/). It's vaguely like an ORM. See the wiki for good examples on how to use it, especially the "Model Definition" and "Writing Queries" pages. We're using this helper library to run migrations (see below).

# Constants

Constants for StreamSchemaKind.
Constants for StreamSchemaKind.

# Variables

Validator used for validation of models.

# Structs

AnonymousSecret implements Secret for anonymous requests.
BaseSecret is the "abstract" base of structs that implement the Secret interface.
CachedInstance contains key information about a stream for rapid (cached) lookup.
CreateStreamCommand contains args for creating a stream.
Organization represents the entity that manages billing on behalf of its users.
OrganizationCreatedEvent is sent when an organization is created.
OrganizationInvite represents invites to use an organization as your billing organization.
OrganizationMember is a convenience representation of organization membership.
OrganizationPermissions represents permissions that a user has for a given organization.
OrganizationTransferredUserEvent is sent when a user is transferred from one org to another.
OrganizationUpdatedEvent is sent when an organization is updated.
PermissionsServicesStreams represnts the many-to-many relationship between services and projects.
PermissionsUsersOrganizations represents the many-to-one relationship between users and organizations.
PermissionsUsersProjects represents the many-to-many relationship between users and projects.
Project represents a Beneath project.
ProjectDeletedEvent is setn when a project is deleted.
ProjectMember is a convenience representation of a user in a project.
ProjectPermissions represents permissions that a user has for a given project.
ProjectUpdatedEvent is sent when a project is updated.
Service represents non-user accounts, which have distinct access permissions, API secrets, monitoring and quotas.
ServiceDeletedEvent is sent when a service is deleted.
ServiceSecret implements Secret for Token entities.
ServiceUpdatedEvent is sent when a service is updated.
Stream represents a collection of data.
StreamCreatedEvent is sent when a stream is created.
StreamDeletedEvent is sent when a stream is deleted.
StreamIndex represents an index on a stream.
StreamInstance represents a single version of a stream (for a streaming stream, there will only be one instance; but for a batch stream, each update represents a new instance).
StreamInstanceCreatedEvent is sent when a stream instance is created.
StreamInstanceDeletedEvent is sent when a stream instance is deleted.
StreamInstanceUpdatedEvent is sent when a stream instance is updated (made primary or final).
StreamPermissions represents permissions that a service has for a given stream.
StreamUpdatedEvent is sent when a stream is updated.
UpdateStreamCommand contains args for updating a stream.
User represents a Beneath user.
UserCreatedEvent is sent when a user is created.
UserSecret implements Secret for User entities.
UserUpdatedEvent is sent when a user is updated.

# Interfaces

Secret represents an access token to Beneath.

# Type aliases

EfficientStreamInstance can be used to efficiently make a UUID conform to engine/driver.StreamInstance.
StreamSchemaKind indicates the SDL of a stream's schema.