entities

package
v0.0.0-...-46c349b Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CHALLENGE_MESSAGE string = `` /* 144-byte string literal not displayed */

the message that will be presented to the user in their wallet when signing

Variables

This section is empty.

Functions

This section is empty.

Types

type Challenge

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

func GenerateChallenge

func GenerateChallenge(address string) Challenge

func NewChallenge

func NewChallenge(address string, message string) Challenge

func (*Challenge) Address

func (c *Challenge) Address() string

func (*Challenge) Message

func (c *Challenge) Message() string

type Comment

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

func NewComment

func NewComment(params CommentParams) Comment

func (*Comment) Content

func (c *Comment) Content() string

func (*Comment) CreatedAt

func (c *Comment) CreatedAt() time.Time

func (*Comment) DeletedAt

func (c *Comment) DeletedAt() *time.Time

func (*Comment) Id

func (c *Comment) Id() int64

func (*Comment) Image

func (c *Comment) Image() *Image

func (*Comment) IsDeleted

func (c *Comment) IsDeleted() bool

func (*Comment) RepliedToComment

func (c *Comment) RepliedToComment() *Comment

func (*Comment) SetRepliedToComment

func (c *Comment) SetRepliedToComment(comment *Comment)

func (*Comment) ThreadId

func (c *Comment) ThreadId() int64

func (*Comment) User

func (c *Comment) User() User

func (*Comment) Votes

func (c *Comment) Votes() int64

type CommentParams

type CommentParams struct {
	Id               int64
	RepliedToComment *Comment
	ThreadId         int64
	Content          string
	Image            Image
	User             User
	IsDeleted        bool
	CreatedAt        time.Time
	DeletedAt        *time.Time
	Votes            int64
}

type Events

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

func NewEvents

func NewEvents(transfers []Transfer) Events

func (Events) Transfers

func (e Events) Transfers() []Transfer

type Image

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

func NewImage

func NewImage(fileName string, originalURL string, originalContentType string, formattedURL string, formattedContentType string) Image

func (Image) FileName

func (i Image) FileName() string

func (Image) FormattedContentType

func (i Image) FormattedContentType() string

func (Image) FormattedURL

func (i Image) FormattedURL() string

func (Image) OriginalContentType

func (i Image) OriginalContentType() string

func (Image) OriginalURL

func (i Image) OriginalURL() string

type Log

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

func NewLog

func NewLog(blockNumber *big.Int, transactionId string, index uint32) Log

func (Log) BlockNumber

func (e Log) BlockNumber() *big.Int

func (Log) Index

func (e Log) Index() uint32

func (Log) TransactionId

func (e Log) TransactionId() string

type Thread

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

func NewThread

func NewThread(params ThreadParams) Thread

func (*Thread) Comments

func (t *Thread) Comments() *[]Comment

returned comments can be nil if not hydrated

func (*Thread) Content

func (t *Thread) Content() string

func (*Thread) CreatedAt

func (t *Thread) CreatedAt() time.Time

func (*Thread) DeletedAt

func (t *Thread) DeletedAt() *time.Time

func (*Thread) Id

func (t *Thread) Id() int64

func (*Thread) Image

func (t *Thread) Image() *Image

func (*Thread) IsDeleted

func (t *Thread) IsDeleted() bool

func (*Thread) SetComments

func (t *Thread) SetComments(comments *[]Comment)

func (*Thread) Title

func (t *Thread) Title() string

func (*Thread) User

func (t *Thread) User() User

func (*Thread) Votes

func (t *Thread) Votes() int64

type ThreadParams

type ThreadParams struct {
	Id        int64
	Title     string
	Content   string
	Image     Image
	User      User
	Comments  *[]Comment
	IsDeleted bool
	CreatedAt time.Time
	DeletedAt *time.Time
	Votes     int64
}

type Transfer

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

func NewTransfer

func NewTransfer(fromAddress string, toAddress string, amount *big.Int, log Log) Transfer

func (Transfer) Amount

func (e Transfer) Amount() *big.Int

func (Transfer) FromAddress

func (e Transfer) FromAddress() string

func (Transfer) Log

func (e Transfer) Log() Log

func (Transfer) ToAddress

func (e Transfer) ToAddress() string

type User

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

func NewUser

func NewUser(params UserParams) User

func (*User) Address

func (u *User) Address() string

func (*User) CreatedAt

func (u *User) CreatedAt() time.Time

func (*User) EnsAvatar

func (u *User) EnsAvatar() *Image

func (*User) EnsName

func (u *User) EnsName() *string

func (*User) Reputation

func (u *User) Reputation() *big.Int

func (*User) UpdatedAt

func (u *User) UpdatedAt() *time.Time

type UserParams

type UserParams struct {
	Address    string
	EnsName    *string
	EnsAvatar  *Image
	Reputation *big.Int
	CreatedAt  time.Time
	UpdatedAt  *time.Time
}

type Vote

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

func NewVote

func NewVote(id int64, address string, value VoteValue, voteType VoteType, updatedAt int64) Vote

func (*Vote) Address

func (v *Vote) Address() string

func (*Vote) Id

func (v *Vote) Id() int64

func (*Vote) Type

func (v *Vote) Type() VoteType

func (*Vote) UpdatedAt

func (v *Vote) UpdatedAt() int64

func (*Vote) Value

func (v *Vote) Value() VoteValue

type VoteType

type VoteType string
const (
	ThreadVote  VoteType = "thread"
	CommentVote VoteType = "comment"
)

type VoteValue

type VoteValue string
const (
	Upvote   VoteValue = "upvote"
	Downvote VoteValue = "downvote"
	Unvote   VoteValue = "unvote"
)

Jump to

Keyboard shortcuts

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