types

package module
v0.0.0-...-c013c52 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: MIT Imports: 3 Imported by: 2

README

Durudex Types

Setup

go get github.com/durudex/go-durudex/types

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatePostInput

type CreatePostInput struct {
	// 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 Post

type Post struct {
	// Post id.
	Id ksuid.KSUID `json:"id"`
	// Post author.
	Author *User `json:"author"`
	// 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"`
	// A list of edges.
	Edges []*PostEdge `json:"edges"`
	// Identifies the total count of items in the connection.
	TotalCount int `json:"totalCount"`
}

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 Session

type Session struct {
	// Session id.
	Id ksuid.KSUID `json:"id"`
	// Session user id.
	UserId ksuid.KSUID `json:"userId"`
	// User session ip address.
	Ip string `json:"ip"`
	// Session expires in.
	ExpiresIn time.Time `json:"expiresIn"`
}

User session.

type SessionConnection

type SessionConnection struct {
	// A list of nodes.
	Nodes []*Session `json:"nodes"`
	// A list of edges.
	Edges []*SessionEdge `json:"edges"`
	// Identifies the total count of items in the connection.
	TotalCount int `json:"totalCount"`
}

List of session owned by the subject.

type SessionCredInput

type SessionCredInput struct {
	// Refresh token.
	Refresh string `json:"refresh"`
	// Client secret key.
	Secret string `json:"secret"`
}

Session credentials input.

type SessionEdge

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

An edge in a session connection.

type SignInInput

type SignInInput struct {
	// Account login.
	Login string `json:"login"`
	// User password
	Password string `json:"password"`
	// Client secret key.
	Secret string `json:"secret"`
}

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"`
	// Client secret key.
	Secret string `json:"secret"`
}

User Sign Up input.

type SortOptions

type SortOptions struct {
	// First query option.
	First *int `json:"first"`
	// Last query option.
	Last *int `json:"last"`
	// Before cursor query option.
	Before *string `json:"before"`
	// After cursor query option.
	After *string `json:"after"`
}

Query sorting 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"`
	// 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 verified status.
	Verified bool `json:"verified"`
	// User avatar url.
	AvatarUrl string `json:"avatarUrl"`
	// User posts connection.
	Posts PostConnection `json:"posts"`
}

User type.

Jump to

Keyboard shortcuts

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