domain

package
v0.0.0-...-1a64ad2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	UserCtx string = "userId"
	IpCtx   string = "Ip"
)
View Source
const (
	CodeServerError         string = "SERVER_ERROR"
	CodeInternalServerError string = "INTERNAL_SERVER_ERROR"
	CodeInvalidArgument     string = "INVALID_ARGUMENT"
	CodeNotFound            string = "NOT_FOUND"
	CodeAlreadyExists       string = "ALREADY_EXISTS"
	CodeUnauthorized        string = "UNAUTHORIZED"
)

GraphQL error status codes.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatePostInput

type CreatePostInput struct {
	// Author id.
	AuthorId ksuid.KSUID
	// Post text.
	Text string `json:"text"`
	// Post attachments.
	Attachments []*UploadFile `json:"attachments"`
}

Create post input.

type ForgotPasswordInput

type ForgotPasswordInput struct {
	// User email.
	Email string `json:"email"`
	// New user password.
	Password string `json:"password"`
	// User verification code.
	Code uint64 `json:"code"`
}

Forgot user password input.

type Node

type Node interface {
	IsNode()
}

GraphQL Node interface.

type PageInfo

type PageInfo struct {
	// When paginating backwards, the cursor to continue.
	StartCursor *string `json:"startCursor"`
	// When paginating forwards, the cursor to continue.
	EndCursor *string `json:"endCursor"`
}

Information about pagination in a connection.

type Post

type Post struct {
	// Post id.
	Id ksuid.KSUID `json:"id"`
	// Post author id.
	AuthorId ksuid.KSUID
	// Post text.
	Text string `json:"text"`
	// Post updated date.
	UpdatedAt *time.Time `json:"updatedAt"`
	// Post attachments.
	Attachments []string `json:"attachments"`
}

Post type.

func (Post) IsNode

func (Post) IsNode()

type PostConnection

type PostConnection struct {
	// A list of nodes.
	Nodes []*Post `json:"nodes"`
}

List of post owned by the subject.

type PostEdge

type PostEdge struct {
	// A cursor for use in pagination.
	Cursor string `json:"cursor"`
	// The item at the end of the edge.
	Node *Post `json:"node"`
}

An edge in a post connection.

type RefreshTokenInput

type RefreshTokenInput struct {
	// Refresh token.
	Token string `json:"token"`
	// User ip address.
	Ip string
}

Refresh tokens input.

type SignInInput

type SignInInput struct {
	// Account username.
	Username string `json:"username"`
	// User password
	Password string `json:"password"`
	// User ip address.
	Ip string
}

User Sign In input.

type SignUpInput

type SignUpInput struct {
	// Account username.
	Username string `json:"username"`
	// User email.
	Email string `json:"email"`
	// User password.
	Password string `json:"password"`
	// User verification code.
	Code uint64 `json:"code"`
	// User ip address.
	Ip string
}

User Sign Up input.

type SortOptions

type SortOptions struct {
	First  *int32
	Last   *int32
	Before ksuid.KSUID
	After  ksuid.KSUID
}

Query sorting options.

func NewSortOptions

func NewSortOptions(first, last *int, before, after *string) (SortOptions, error)

Creating a new query sort options.

type Tokens

type Tokens struct {
	// JWT access token.
	Access string `json:"access"`
	// Refresh token.
	Refresh string `json:"refresh"`
}

Authorization tokens.

type UpdatePostInput

type UpdatePostInput struct {
	// Post id.
	Id ksuid.KSUID `json:"id"`
	// Author id.
	AuthorId ksuid.KSUID
	// Post text.
	Text string `json:"text"`
}

Update post input.

type UploadFile

type UploadFile struct {
	// File id.
	Id int `json:"id"`
	// File data.
	File graphql.Upload `json:"file"`
}

Upload files input.

type User

type User struct {
	// User id.
	Id ksuid.KSUID `json:"id"`
	// Username.
	Username string `json:"username"`
	// User last visit date.
	LastVisit time.Time `json:"lastVisit"`
	// User verified status.
	Verified bool `json:"verified"`
	// User avatar url.
	AvatarUrl *string `json:"avatarUrl"`
}

User type.

func (User) IsNode

func (User) IsNode()

Jump to

Keyboard shortcuts

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