models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 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 Block

type Block struct {
	bun.BaseModel `bun:"table:blocks,alias:b"`

	ID        uuid.UUID `bun:"id,pk,type:uuid" json:"id"`
	BlockerID uuid.UUID `bun:"blocker_id,notnull,type:uuid" json:"blocker_id"`
	BlockedID uuid.UUID `bun:"blocked_id,notnull,type:uuid" json:"blocked_id"`
	CreatedAt time.Time `bun:"created_at,nullzero,notnull" json:"created_at"`
}

type BlockInput

type BlockInput struct {
	AccountID uuid.UUID `json:"account_id" binding:"required"`
}

type BlockedUser

type BlockedUser struct {
	AccountID uuid.UUID `json:"account_id"`
	Since     time.Time `json:"since"`
}

BlockedUser is the client-facing view of a block.

type ErrorResponse

type ErrorResponse struct {
	Error   string `json:"error"`
	Message string `json:"message,omitempty"`
}

ErrorResponse matches BananAuth's error format.

type Friend

type Friend struct {
	AccountID uuid.UUID `json:"account_id"`
	Since     time.Time `json:"since"`
}

Friend is the client-facing view — the "other person" in the relationship.

type FriendRequest

type FriendRequest struct {
	ID            uuid.UUID `json:"id"`
	FromAccountID uuid.UUID `json:"from_account_id"`
	ToAccountID   uuid.UUID `json:"to_account_id"`
	CreatedAt     time.Time `json:"created_at"`
}

FriendRequest is a pending friendship.

type Friendship

type Friendship struct {
	bun.BaseModel `bun:"table:friendships,alias:f"`

	ID          uuid.UUID        `bun:"id,pk,type:uuid" json:"id"`
	RequesterID uuid.UUID        `bun:"requester_id,notnull,type:uuid" json:"requester_id"`
	AddresseeID uuid.UUID        `bun:"addressee_id,notnull,type:uuid" json:"addressee_id"`
	Status      FriendshipStatus `bun:"status,notnull" json:"status"`
	CreatedAt   time.Time        `bun:"created_at,nullzero,notnull" json:"created_at"`
	UpdatedAt   time.Time        `bun:"updated_at,nullzero,notnull" json:"updated_at"`
}

type FriendshipStatus

type FriendshipStatus string
const (
	StatusPending  FriendshipStatus = "pending"
	StatusAccepted FriendshipStatus = "accepted"
)

type HandleRequestInput

type HandleRequestInput struct {
	RequestID uuid.UUID `json:"request_id" binding:"required"`
}

type SendRequestInput

type SendRequestInput struct {
	FriendID uuid.UUID `json:"friend_id" binding:"required"`
}

Jump to

Keyboard shortcuts

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