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" )
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 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.
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.