model

package
v0.0.0-...-f270e70 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllRole = []Role{
	RoleAdmin,
	RoleUser,
}

Functions

func ConvertUnixTimeToTime

func ConvertUnixTimeToTime(unix interface{}) *time.Time

Types

type Article

type Article struct {
	ID            string        `json:"id"`
	ArticleKey    string        `json:"articleKey"`
	Content       *string       `json:"content"`
	PublishOption PublishOption `json:"publishOption"`
	CreatedAt     *string       `json:"createdAt"`
	UpdatedAt     *string       `json:"updatedAt"`
	XJwtToken     *string       `json:"xJwtToken"`
}

func (Article) GetID

func (this Article) GetID() string

func (Article) IsNode

func (Article) IsNode()

type ArticleByArticleKeyInput

type ArticleByArticleKeyInput struct {
	BlogKey    string  `json:"blogKey"`
	ArticleKey string  `json:"articleKey"`
	Password   *string `json:"password"`
	XJwtToken  *string `json:"xJwtToken"`
}

type ArticleByKeyOpts

type ArticleByKeyOpts struct {
	UserId   *int
	Password *string
}

type ArticleConnection

type ArticleConnection struct {
	PageInfo  *PageInfo      `json:"pageInfo"`
	Edges     []*ArticleEdge `json:"edges"`
	XJwtToken *string        `json:"xJwtToken"`
}

func (ArticleConnection) GetEdges

func (this ArticleConnection) GetEdges() []Edge

func (ArticleConnection) GetPageInfo

func (this ArticleConnection) GetPageInfo() *PageInfo

func (ArticleConnection) IsConnection

func (ArticleConnection) IsConnection()

type ArticleEdge

type ArticleEdge struct {
	Cursor string   `json:"cursor"`
	Node   *Article `json:"node"`
}

func (ArticleEdge) GetCursor

func (this ArticleEdge) GetCursor() string

func (ArticleEdge) GetNode

func (this ArticleEdge) GetNode() Node

func (ArticleEdge) IsEdge

func (ArticleEdge) IsEdge()

type ArticleForDB

type ArticleForDB struct {
	ID            string        `json:"id"`
	ArticleKey    string        `json:"articleKey"`
	Content       *string       `json:"content"`
	PublishOption PublishOption `json:"publishOption"`
	CreatedAt     *time.Time    `json:"createdAt"`
	UpdatedAt     *time.Time    `json:"updatedAt"`
}

func (*ArticleForDB) ConvertArticleForDBToArticle

func (afdb *ArticleForDB) ConvertArticleForDBToArticle() *Article

type ArticlePaginationInput

type ArticlePaginationInput struct {
	First  *int    `json:"first"`
	After  *string `json:"after"`
	Last   *int    `json:"last"`
	Before *string `json:"before"`
}

type Blog

type Blog struct {
	ID            string        `json:"id"`
	BlogKey       string        `json:"blogKey"`
	Author        *string       `json:"author"`
	Name          *string       `json:"name"`
	Description   *string       `json:"description"`
	PublishOption PublishOption `json:"publishOption"`
	PasswordHint  string        `json:"passwordHint"`
	Links         []*BlogLink   `json:"links"`
	CreatedAt     *string       `json:"createdAt"`
	UpdatedAt     *string       `json:"updatedAt"`
	XJwtToken     *string       `json:"xJwtToken"`
}

func (Blog) GetID

func (this Blog) GetID() string

func (Blog) IsNode

func (Blog) IsNode()

type BlogByBlogKeyInput

type BlogByBlogKeyInput struct {
	BlogKey   string  `json:"blogKey"`
	Password  *string `json:"password"`
	XJwtToken *string `json:"xJwtToken"`
}

type BlogByKeyOpts

type BlogByKeyOpts struct {
	UserId   *int
	Password *string
}

type BlogForDB

type BlogForDB struct {
	ID                string           `json:"id"`
	BlogKey           string           `json:"blogKey"`
	UserId            int              `json:"user"`
	Author            *string          `json:"author"`
	Name              *string          `json:"name"`
	Description       *string          `json:"description"`
	PublishOption     PublishOption    `json:"publishOption"`
	PasswordUpdatedAt time.Time        `json:"passwordUpdatedAt"`
	PasswordHint      string           `json:"passwordHint"`
	Links             *json.RawMessage `json:"links"`
	CreatedAt         *time.Time       `json:"createdAt"`
	UpdatedAt         *time.Time       `json:"updatedAt"`
}

func (*BlogForDB) ConvertBlogForDBToBlog

func (bfdb *BlogForDB) ConvertBlogForDBToBlog() *Blog
type BlogLink struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	URL  string `json:"url"`
}

func (BlogLink) GetID

func (this BlogLink) GetID() string

func (BlogLink) IsNode

func (BlogLink) IsNode()

type BlogLinkInput

type BlogLinkInput struct {
	Name *string `json:"name"`
	URL  string  `json:"url"`
}

type Config

type Config struct {
	AllowRegister bool `json:"allowRegister"`
}

type ConfigForDB

type ConfigForDB struct {
	ID            int
	AllowRegister int
}

func (*ConfigForDB) ConvertConfigForDBToConfig

func (cfdb *ConfigForDB) ConvertConfigForDBToConfig() *Config

type Connection

type Connection interface {
	IsConnection()
	GetPageInfo() *PageInfo
	GetEdges() []Edge
}

type CreateArticleInput

type CreateArticleInput struct {
	BlogID  string `json:"blogId"`
	Content string `json:"content"`
}

type CreateBlogInput

type CreateBlogInput struct {
	Author        string           `json:"author"`
	Name          string           `json:"name"`
	Description   *string          `json:"description"`
	PublishOption PublishOption    `json:"publishOption"`
	Password      *string          `json:"password"`
	PasswordHint  *string          `json:"passwordHint"`
	Links         []*BlogLinkInput `json:"links"`
}

type Edge

type Edge interface {
	IsEdge()
	GetCursor() string
	GetNode() Node
}

type LoginInput

type LoginInput struct {
	Token string `json:"token"`
}

type MasterParameter

type MasterParameter struct {
	MaxBlogs     int `json:"maxBlogs"`
	MaxBlogLinks int `json:"maxBlogLinks"`
}

type Node

type Node interface {
	IsNode()
	GetID() string
}

type PageInfo

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

type ProviderUserForDB

type ProviderUserForDB struct {
	UID       string
	Provider  string
	UserId    int
	CreatedAt time.Time
	UpdatedAt time.Time
}

type PublishOption

type PublishOption string
const (
	PublishOptionPublic   PublishOption = "PUBLIC"
	PublishOptionPassword PublishOption = "PASSWORD"
	PublishOptionPrivate  PublishOption = "PRIVATE"
)

func (PublishOption) IsValid

func (e PublishOption) IsValid() bool

func (PublishOption) MarshalGQL

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

func (PublishOption) String

func (e PublishOption) String() string

func (*PublishOption) UnmarshalGQL

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

type PublishOptionAndPasswordUpdatedAt

type PublishOptionAndPasswordUpdatedAt struct {
	PublishOption     PublishOption
	PasswordUpdatedAt time.Time
}

type QueryArgs

type QueryArgs struct {
	Query string
	Args  []interface{}
}

type Role

type Role string
const (
	RoleAdmin     Role = "ADMIN"
	RoleUser      Role = "USER"
	RoleUndefined Role = "UNDEFINED"
)

func ConvertToRole

func ConvertToRole(v string) Role

func (Role) IsValid

func (e Role) IsValid() bool

func (Role) MarshalGQL

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

func (Role) String

func (e Role) String() string

func (*Role) UnmarshalGQL

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

type UpdateArticleInput

type UpdateArticleInput struct {
	ID      string `json:"id"`
	Content string `json:"content"`
}

type UpdateBlogInput

type UpdateBlogInput struct {
	ID            string                 `json:"id"`
	Author        *string                `json:"author"`
	Name          *string                `json:"name"`
	Description   *string                `json:"description"`
	PublishOption *PublishOption         `json:"publishOption"`
	Password      *string                `json:"password"`
	PasswordHint  *string                `json:"passwordHint"`
	Links         []*UpdateBlogLinkInput `json:"links"`
}

type UpdateBlogLinkInput

type UpdateBlogLinkInput struct {
	ID   *string `json:"id"`
	Name string  `json:"name"`
	URL  string  `json:"url"`
}

type UpdateConfigInput

type UpdateConfigInput struct {
	AllowRegister *bool `json:"allowRegister"`
}

type UpdateUserInput

type UpdateUserInput struct {
	ID           int
	Role         *Role
	LastLogined  *time.Time
	LastLogouted *time.Time
}

type UserForDB

type UserForDB struct {
	ID           int
	Role         Role
	LastLogined  time.Time
	LastLogouted *time.Time
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

type UserInfoByToken

type UserInfoByToken struct {
	UID      string
	Provider string
	Role     Role
	IssuedAt time.Time
}

Jump to

Keyboard shortcuts

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