entity

package
v0.0.0-...-135ac7b Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID        string          `json:"id"`
	PubKey    string          `json:"pubkey"`
	CreatedAt int64           `json:"created_at"` // secs
	Kind      int             `json:"kind"`
	Tags      json.RawMessage `gorm:"type:jsonb" json:"tags"`
	Content   string          `json:"content"`
	Sig       string          `json:"sig"`
}

func FromNostrEvent

func FromNostrEvent(e *nostr.Event) (Event, error)

type Events

type Events []Event

func (Events) Len

func (a Events) Len() int

func (Events) Less

func (a Events) Less(i, j int) bool

func (Events) Swap

func (a Events) Swap(i, j int)

type Nip5Response

type Nip5Response struct {
	Names  map[string]string   `json:"names"`
	Relays map[string][]string `json:"relays"`
}

type Nips

type Nips []int

type Relay

type Relay struct {
	Url  string
	Read string
}

type RelayMeta

type RelayMeta struct {
	Name          string          `json:"name"`
	Description   string          `json:"description"`
	Pubkey        string          `json:"pubkey"`
	Contact       string          `json:"contact"`
	SupportedNips json.RawMessage `json:"supported_nips" gorm:"type:jsonb"`
	Software      string          `json:"software"`
	Version       string          `json:"version"`
}

type ReqLog

type ReqLog struct {
	gorm.Model

	AcceptLanguage string
	UserAgent      string
	Origin         string
	CFIPCountry    string
	CFConnectingIP string
	ReqBody        json.RawMessage `gorm:"type:jsonb"`
}

type SpamUser

type SpamUser struct {
	User string
}

type User

type User struct {
	gorm.Model
	Pubkey     string `gorm:"primaryKey"`
	Name       string
	About      string
	Picture    string
	SignedNip5 bool
	Relays     json.RawMessage `gorm:"type:jsonb"`
}

func GetUserFromProtocol

func GetUserFromProtocol(event *nostr.Event) (user User, e error)

Jump to

Keyboard shortcuts

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