routes

package
v0.0.0-...-30d0c4a Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_UPLOAD_SIZE       = 10 * 1024 * 1024 // 10MB
	USER_IMAGES_CONTAINER = "user-images"
	USERS_TOPIC           = "users"
)

Variables

This section is empty.

Functions

func CreateHandler

func CreateHandler(settings configuration.Settings, env *Env) http.Handler

func GetJwt

func GetJwt(signingKey string, tokenExpirationSeconds uint16, userId string) (string, error)

Types

type DocumentContributorCreate

type DocumentContributorCreate struct {
	UserID uuid.UUID `json:"userId"`
}

type DocumentCreate

type DocumentCreate struct {
	Name string `json:"name"`
}

type DocumentListItem

type DocumentListItem struct {
	ID   uuid.UUID `json:"id"`
	Name string    `json:"name"`
}

type DocumentResponse

type DocumentResponse struct {
	ID           uuid.UUID   `json:"id"`
	Name         string      `json:"name"`
	OwnerID      uuid.UUID   `json:"ownerId"`
	Contributors []uuid.UUID `json:"contributors"`
}

type Env

type Env struct {
	Pool         *pgxpool.Pool
	Producer     *kafka.Writer
	Blob         *azblob.Client
	SearchClient *elasticsearch.TypedClient
}

type TokenResponse

type TokenResponse struct {
	Token            string `json:"token"`
	ExpiresInSeconds uint16 `json:"expiresInSeconds"`
}

type UserCreate

type UserCreate struct {
	Email    string `json:"email"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type UserCredentials

type UserCredentials struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type UserListItem

type UserListItem struct {
	ID       uuid.UUID `json:"id"`
	Email    string    `json:"email"`
	Username string    `json:"username"`
	ImageUrl string    `json:"imageUrl"`
}

type UserResponse

type UserResponse struct {
	ID       uuid.UUID `json:"id"`
	Email    string    `json:"email"`
	Username string    `json:"username"`
	ImageUrl string    `json:"imageUrl"`
}

Jump to

Keyboard shortcuts

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