Documentation ¶
Overview ¶
Package internal contains internal storer code
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbCommon ¶
type DbCommon struct { ID string `db:"id" goqu:"skipupdate"` Name string `db:"name"` Description *string `db:"description"` *DbTimestamps }
DbCommon is a struct that maps to common fields we use
func MakeDbCommon ¶
func MakeDbCommon(id, name, desc string, timestamps *statusthingv1.Timestamps) (*DbCommon, error)
MakeDbCommon builds the minimum required common fields of all db records
type DbItem ¶
DbItem represents a common representation of an statusthingv1.Item in a db
func DbItemFromProto ¶
func DbItemFromProto(pbitem *statusthingv1.Item) (*DbItem, error)
DbItemFromProto creates a DbItem from a statusthingv1.Item
func (*DbItem) ToProto ¶
func (s *DbItem) ToProto() (*statusthingv1.Item, error)
ToProto converts a DbItem to a statusthingv1.Item
type DbNote ¶
type DbNote struct { ID string `db:"id"` NoteText string `db:"note_text"` ItemID string `db:"item_id"` *DbTimestamps }
DbNote is a common representation of a statusthingv1.Note in a database
func DbNoteFromProto ¶
func DbNoteFromProto(pbnote *statusthingv1.Note) (*DbNote, error)
DbNoteFromProto returns a DbNote from a statusthingv1.Note
func (*DbNote) ToProto ¶
func (n *DbNote) ToProto() (*statusthingv1.Note, error)
ToProto returns a statusthingv1.Note from a DbNote
type DbProtoable ¶
DbProtoable is something that can convert a dbresult to a protobuf message
type DbStatus ¶
DbStatus represents a common representation of a statusthingv1.Status in a db
func DbStatusFromProto ¶
func DbStatusFromProto(pbstatus *statusthingv1.Status) (*DbStatus, error)
DbStatusFromProto creates a DbStatus from a statusthingv1.Status
type DbTimestamps ¶
type DbTimestamps struct { Created uint64 `db:"created"` Updated uint64 `db:"updated"` Deleted *uint64 `db:"deleted"` }
DbTimestamps represents a statusthingv1.Timestamps as a db record
func MakeDbTimestamps ¶
func MakeDbTimestamps(timestamps *statusthingv1.Timestamps) (*DbTimestamps, error)
MakeDbTimestamps converts a DbTimestamps to a statusthingv1.Timestamps
type DbUser ¶
type DbUser struct { ID string `db:"id" goqu:"skipupdate"` Username string `db:"username"` Password string `db:"password"` FirstName *string `db:"first_name"` LastName *string `db:"last_name"` EmailAddress *string `db:"email_address"` LastLogin *uint64 `db:"last_login"` AvatarURL *string `db:"avatar_url"` *DbTimestamps }
DbUser represents a user stored in a database
func DbUserFromProto ¶
DbUserFromProto creates a [DBUser] from a v1.User
type ProtoStorer ¶
type ProtoStorer interface { Insert(ctx context.Context, pb proto.Message) (proto.Message, error) Select(ctx context.Context, idval string) (proto.Message, error) Update(ctx context.Context, idval string, opts ...filters.FilterOption) error Delete(ctx context.Context, idval string) error Where(ctx context.Context, opts ...filters.FilterOption) ([]proto.Message, error) }
ProtoStorer is something that can store protobuf messages Not sold on this yet - just needed to dump it