inbox

package
v0.0.0-...-a0d1ad3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT, Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InboxTableName = "inboxes"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewActivity

func NewActivity(name string, body []byte) (*Handler, error)

NewActivity The received inbox data is constructed into an InboxActivity, Then handed over to the handler for further processing.

func NewHandler

func NewHandler(actorId uint, body []byte) *Handler

func (*Handler) Handler

func (h *Handler) Handler() error

type Ibx

type Ibx interface {
	Create() error
	DeleteByActivityId() error
	GetInbox() (*Inboxes, error)
	DeleteInbox() error
	GetInboxes() ([]*Inboxes, error)
	SetViewed() error
}

type Inboxes

type Inboxes struct {
	gorm.Model

	ActorId    uint   `gorm:"primaryKey;type:bigint;actor_id"`
	ActivityId string `gorm:"primaryKey;type:text;activity_id"`
	From       string `gorm:"type:text;sender_addr"`
	Types      string `gorm:"type:text;types"`
	Body       string `gorm:"type:text;body"`
	Viewed     bool   `gorm:"type:boolean;viewed"`
}

func NewInboxes

func NewInboxes(actorId uint, activityId, from, types, body string) *Inboxes

func NewInboxesDeleteByActivityId

func NewInboxesDeleteByActivityId(actorId uint, activityId string) *Inboxes

func NewInboxesIdAndActorId

func NewInboxesIdAndActorId(id, actorId uint) *Inboxes

func NewInboxesReceiverId

func NewInboxesReceiverId(actorId uint) *Inboxes

func NewSetViewed

func NewSetViewed(actorId, inboxId uint) *Inboxes

func (*Inboxes) Create

func (i *Inboxes) Create() error

func (*Inboxes) DeleteByActivityId

func (i *Inboxes) DeleteByActivityId() error

func (*Inboxes) DeleteInbox

func (i *Inboxes) DeleteInbox() error

func (*Inboxes) GetInbox

func (i *Inboxes) GetInbox() (*Inboxes, error)

func (*Inboxes) GetInboxes

func (i *Inboxes) GetInboxes() ([]*Inboxes, error)

func (*Inboxes) SetViewed

func (i *Inboxes) SetViewed() error

Jump to

Keyboard shortcuts

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