models

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LedgerEntry

type LedgerEntry struct {
	Timestamp time.Time
	ID        uuid.UUID
	Prev      uuid.UUID
	Subject   uuid.UUID
	Content   []byte
}

type Post

type Post struct {
	ID        uuid.UUID `json:"id"`
	Timestamp time.Time `json:"timestamp"`
	User      User      `json:"user"`
	Message   string    `json:"message"`
}

type PostDisplay

type PostDisplay struct {
	ID                uuid.UUID `json:"id"`
	Timestamp         time.Time `json:"timestamp"`
	UserID            uuid.UUID `json:"user_id"`
	UserPreferredName string    `json:"user_preferred_name"`
	UserFingerprint   string    `json:"user_fingerprint"`
	Message           string    `json:"message"`
}

type RegisterRequest

type RegisterRequest struct {
	Email     string `json:"email"`
	PublicKey string `json:"public_key"`
	Name      string `json:"name"`
}

type RegisterResponse

type RegisterResponse struct {
	Timestamp string `json:"timestamp"`
	Message   string `json:"message"`
}

type SendPostRequest

type SendPostRequest struct {
	Owner   uuid.UUID `json:"owner"`
	Message string    `json:"message"`
}

type SendPostResponse

type SendPostResponse struct {
	Timestamp string `json:"timestamp"`
	Message   string `json:"message"`
}

type User

type User struct {
	ID            uuid.UUID     `db:"id"`
	Email         string        `db:"email" json:"-"`
	PreferredName string        `db:"preferred_name"`
	PublicKey     ssh.PublicKey `db:"public_key"`
	CreatedAt     time.Time     `db:"created_at" json:"-"`
	UpdatedAt     time.Time     `db:"updated_at" json:"-"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL