api

package
v0.0.0-...-c5b329c Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateAccountRequest

type CreateAccountRequest struct {
	Currency string `json:"currency" binding:"required,currency"`
}

type CreateUserRequest

type CreateUserRequest struct {
	Username string `json:"username" binding:"required,alphanum"`
	Password string `json:"password" binding:"required,min=5"`
	FullName string `json:"full_name" binding:"required,min=3"`
	Email    string `json:"email" binding:"required,email"`
}

type LoginUserRequest

type LoginUserRequest struct {
	Username string `json:"username" binding:"required,alphanum"`
	Password string `json:"password" binding:"required,min=5"`
}

type LoginUserResponse

type LoginUserResponse struct {
	SessionID             uuid.UUID    `json:"session_id"`
	AccessToken           string       `json:"access_token"`
	AccessTokenExpiresAt  time.Time    `json:"access_token_expires_at"`
	RefreshToken          string       `json:"refresh_token"`
	RefreshTokenExpiresAt time.Time    `json:"refresh_token_expires_at"`
	User                  userResponse `json:"user"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server struct serves HTTP requests for our banking service

func NewServer

func NewServer(config util.Config, store db.Store) (*Server, error)

NewServer creates a new HTTP server and setup routing

func (*Server) StartServer

func (server *Server) StartServer(address string) error

StartServer runs the HTTP server on a specific address

Jump to

Keyboard shortcuts

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