model

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type AddMxid

type AddMxid struct {
	Mxid string `json:"mxid"`
}

type AddToLists

type AddToLists struct {
	Lists []string `json:"lists"`
	Entry string   `json:"entry"`
}

type Comment

type Comment struct {
	Timestamp time.Time `json:"timestamp"`
	AuthorID  *primitive.ObjectID
	Content   string `json:"content"`
}

func MakeComment

func MakeComment(dbComment *model.DBComment) *Comment

type CommentConnection

type CommentConnection struct {
	PageInfo *PageInfo      `json:"pageInfo"`
	Edges    []*CommentEdge `json:"edges"`
}

type CommentEdge

type CommentEdge struct {
	Node   *Comment `json:"node"`
	Cursor string   `json:"cursor"`
}

type CommentEntry

type CommentEntry struct {
	Entry   string `json:"entry"`
	Comment string `json:"comment"`
}

type CommentList

type CommentList struct {
	List    string `json:"list"`
	Comment string `json:"comment"`
}

type CreateEntry

type CreateEntry struct {
	Tags      []string `json:"tags"`
	PartOf    []string `json:"partOf"`
	HashValue string   `json:"hashValue"`
	Comment   *string  `json:"comment"`
}

type CreateList

type CreateList struct {
	Name        string   `json:"name"`
	Tags        []string `json:"tags"`
	Comment     *string  `json:"comment"`
	Maintainers []string `json:"maintainers"`
	Entries     []string `json:"entries"`
}

type Entry

type Entry struct {
	ID          string   `json:"id"`
	Tags        []string `json:"tags"`
	PartOfIDs   []*primitive.ObjectID
	HashValue   string    `json:"hashValue"`
	FileURL     *string   `json:"fileUrl"`
	Timestamp   time.Time `json:"timestamp"`
	AddedByID   primitive.ObjectID
	RawComments []*model.DBComment
}

func MakeEntry

func MakeEntry(dbEntry *model.DBEntry) *Entry

type EntryArrayFilter

type EntryArrayFilter struct {
	ContainsAll []*EntryFilter `json:"containsAll"`
	ContainsOne []*EntryFilter `json:"containsOne"`
	Length      *int           `json:"length"`
}

type EntryConnection

type EntryConnection struct {
	PageInfo *PageInfo    `json:"pageInfo"`
	Edges    []*EntryEdge `json:"edges"`
}

type EntryEdge

type EntryEdge struct {
	Node   *Entry `json:"node"`
	Cursor string `json:"cursor"`
}

type EntryFilter

type EntryFilter struct {
	ID        *string            `json:"id"`
	HashValue *StringFilter      `json:"hashValue"`
	Tags      *StringArrayFilter `json:"tags"`
	AddedBy   *string            `json:"addedBy"`
	Timestamp *TimestampFilter   `json:"timestamp"`
	PartOf    *IDArrayFilter     `json:"partOf"`
}

type EntrySort

type EntrySort struct {
	ID        *SortRule `json:"id"`
	HashValue *SortRule `json:"hashValue"`
	Timestamp *SortRule `json:"timestamp"`
	AddedBy   *SortRule `json:"addedBy"`
}

type HashCheckerConfig

type HashCheckerConfig struct {
	ChatNotice      bool            `json:"chatNotice"`
	HashCheckMode   HashCheckerMode `json:"hashCheckMode"`
	SubscribedLists []string        `json:"subscribedLists"`
}

type HashCheckerConfigUpdate

type HashCheckerConfigUpdate struct {
	ChatNotice    *bool            `json:"chatNotice"`
	HashCheckMode *HashCheckerMode `json:"hashCheckMode"`
}

type HashCheckerMode

type HashCheckerMode string
const (
	HashCheckerModeNotice HashCheckerMode = "NOTICE"
	HashCheckerModeDelete HashCheckerMode = "DELETE"
	HashCheckerModeMute   HashCheckerMode = "MUTE"
	HashCheckerModeBan    HashCheckerMode = "BAN"
)

func (HashCheckerMode) IsValid

func (e HashCheckerMode) IsValid() bool

func (HashCheckerMode) MarshalGQL

func (e HashCheckerMode) MarshalGQL(w io.Writer)

func (HashCheckerMode) String

func (e HashCheckerMode) String() string

func (*HashCheckerMode) UnmarshalGQL

func (e *HashCheckerMode) UnmarshalGQL(v interface{}) error

type IDArrayFilter

type IDArrayFilter struct {
	ContainsAll []*string `json:"containsAll"`
	Length      *int      `json:"length"`
}

type IntFilter

type IntFilter struct {
	Gt  *int `json:"gt"`
	Lt  *int `json:"lt"`
	Eq  *int `json:"eq"`
	Neq *int `json:"neq"`
}

type List

type List struct {
	ID            string   `json:"id"`
	Name          string   `json:"name"`
	Tags          []string `json:"tags"`
	RawComments   []*model.DBComment
	MaintainerIDs []*primitive.ObjectID
	CreatorID     primitive.ObjectID
}

func MakeList

func MakeList(dbList *model.DBHashList) *List

type ListArrayFilter

type ListArrayFilter struct {
	ContainsAll []*ListFilter `json:"containsAll"`
	ContainsOne []*ListFilter `json:"containsOne"`
	Length      *int          `json:"length"`
}

type ListConnection

type ListConnection struct {
	PageInfo *PageInfo   `json:"pageInfo"`
	Edges    []*ListEdge `json:"edges"`
}

type ListEdge

type ListEdge struct {
	Node   *List  `json:"node"`
	Cursor string `json:"cursor"`
}

type ListFilter

type ListFilter struct {
	ID          *string            `json:"id"`
	Name        *StringFilter      `json:"name"`
	Tags        *StringArrayFilter `json:"tags"`
	Maintainers *IDArrayFilter     `json:"maintainers"`
}

type ListSort

type ListSort struct {
	ID   *SortRule `json:"id"`
	Name *SortRule `json:"name"`
}

type ListSubscriptionUpdate

type ListSubscriptionUpdate struct {
	RoomID string `json:"roomId"`
	ListID string `json:"listId"`
}

type Login

type Login struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type PageInfo

type PageInfo struct {
	HasPreviousPage bool   `json:"hasPreviousPage"`
	HasNextPage     bool   `json:"hasNextPage"`
	StartCursor     string `json:"startCursor"`
	EndCursor       string `json:"endCursor"`
}

type Register

type Register struct {
	Username string `json:"username"`
	Password string `json:"password"`
	MxID     string `json:"mxID"`
}

type RemoveFromLists

type RemoveFromLists struct {
	Lists []string `json:"lists"`
	Entry string   `json:"entry"`
}

type RemoveMxid

type RemoveMxid struct {
	Mxid string `json:"mxid"`
}

type Room

type Room struct {
	ID                string             `json:"id"`
	Active            bool               `json:"active"`
	Deactivated       bool               `json:"deactivated"`
	Name              string             `json:"name"`
	RoomID            string             `json:"roomId"`
	Debug             bool               `json:"debug"`
	AdminPowerLevel   int                `json:"adminPowerLevel"`
	HashCheckerConfig *HashCheckerConfig `json:"hashCheckerConfig"`
}

func MakeRoom

func MakeRoom(room *config.RoomConfig) *Room

type RoomConfigUpdate

type RoomConfigUpdate struct {
	ID              string                   `json:"id"`
	Deactivate      *bool                    `json:"deactivate"`
	Debug           *bool                    `json:"debug"`
	AdminPowerLevel *int                     `json:"adminPowerLevel"`
	HashChecker     *HashCheckerConfigUpdate `json:"hashChecker"`
}

type RoomConnection

type RoomConnection struct {
	PageInfo *PageInfo   `json:"pageInfo"`
	Edges    []*RoomEdge `json:"edges"`
}

type RoomEdge

type RoomEdge struct {
	Node   *Room  `json:"node"`
	Cursor string `json:"cursor"`
}

type RoomFilter

type RoomFilter struct {
	ID      *string `json:"id"`
	Active  *bool   `json:"active"`
	Debug   *bool   `json:"debug"`
	CanEdit *bool   `json:"canEdit"`
}

type SortDirection

type SortDirection string
const (
	SortDirectionAsc  SortDirection = "ASC"
	SortDirectionDesc SortDirection = "DESC"
)

func (SortDirection) IsValid

func (e SortDirection) IsValid() bool

func (SortDirection) MarshalGQL

func (e SortDirection) MarshalGQL(w io.Writer)

func (SortDirection) String

func (e SortDirection) String() string

func (*SortDirection) UnmarshalGQL

func (e *SortDirection) UnmarshalGQL(v interface{}) error

type SortRule

type SortRule struct {
	Direction SortDirection `json:"direction"`
}

type StringArrayFilter

type StringArrayFilter struct {
	ContainsAll []*string     `json:"containsAll"`
	ElemMatch   *StringFilter `json:"elemMatch"`
	Length      *int          `json:"length"`
}

type StringFilter

type StringFilter struct {
	Eq    *string `json:"eq"`
	Neq   *string `json:"neq"`
	Regex *string `json:"regex"`
}

type TimestampFilter

type TimestampFilter struct {
	After  *time.Time `json:"after"`
	Before *time.Time `json:"before"`
}

type User

type User struct {
	ID                 string    `json:"id"`
	Username           string    `json:"username"`
	Admin              *bool     `json:"admin"`
	MatrixLinks        []*string `json:"matrixLinks"`
	PendingMatrixLinks []*string `json:"pendingMatrixLinks"`
}

func MakeUser

func MakeUser(dbUser *model.DBUser) *User

type UserArrayFilter

type UserArrayFilter struct {
	ContainsAll []*UserFilter `json:"containsAll"`
	ContainsOne []*UserFilter `json:"containsOne"`
	Length      *int          `json:"length"`
}

type UserConnection

type UserConnection struct {
	PageInfo *PageInfo   `json:"pageInfo"`
	Edges    []*UserEdge `json:"edges"`
}

type UserEdge

type UserEdge struct {
	Node   *User  `json:"node"`
	Cursor string `json:"cursor"`
}

type UserFilter

type UserFilter struct {
	ID                 *string            `json:"id"`
	Username           *StringFilter      `json:"username"`
	MatrixLinks        *StringArrayFilter `json:"matrixLinks"`
	PendingMatrixLinks *StringArrayFilter `json:"pendingMatrixLinks"`
	Admin              *bool              `json:"admin"`
}

type UserRole

type UserRole string
const (
	UserRoleAdmin           UserRole = "ADMIN"
	UserRoleUser            UserRole = "USER"
	UserRoleUnauthenticated UserRole = "UNAUTHENTICATED"
)

func (UserRole) IsValid

func (e UserRole) IsValid() bool

func (UserRole) MarshalGQL

func (e UserRole) MarshalGQL(w io.Writer)

func (UserRole) String

func (e UserRole) String() string

func (*UserRole) UnmarshalGQL

func (e *UserRole) UnmarshalGQL(v interface{}) error

type UserSort

type UserSort struct {
	ID       *SortRule `json:"id"`
	Username *SortRule `json:"username"`
	Admin    *SortRule `json:"admin"`
}

Jump to

Keyboard shortcuts

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