api

package
v0.0.0-...-e5441ae Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthMiddleware

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

func NewAuthMiddleware

func NewAuthMiddleware(conf *config.Config, authManager *usecases.AuthManager) *AuthMiddleware

type BlogCreatorV1

type BlogCreatorV1 struct {
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
}

type BlogResponseV1

type BlogResponseV1 struct {
	ID        int64          `json:"id"`
	Creator   *BlogCreatorV1 `json:"creator"`
	Title     string         `json:"title"`
	Content   string         `json:"content"`
	Tags      string         `json:"tags"`
	CreatedAt time.Time      `json:"createdAt"`
	UpdatedAt time.Time      `json:"updatedAt"`
}

type CreateBlogRequestV1

type CreateBlogRequestV1 struct {
	Title   string `json:"title"`
	Content string `json:"content"`
	Tags    string `json:"tags"`
}

type CreateBlogResponseV1

type CreateBlogResponseV1 struct {
	ID int64 `json:"id"`
}

type CreateUserRequestV1

type CreateUserRequestV1 struct {
	Username  string `json:"username"`
	Password  string `json:"password"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
}

type LoginRequestV1

type LoginRequestV1 struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type LoginResponseV1

type LoginResponseV1 struct {
	Token string `json:"token"`
}

type UpdateBlogRequestV1

type UpdateBlogRequestV1 struct {
	ID      int64    `json:"id"`
	Title   string   `json:"title"`
	Content string   `json:"content"`
	Tags    []string `json:"tags"`
}

type UpdateUserRequestV1

type UpdateUserRequestV1 struct {
	Username  string `json:"username"`
	Password  string `json:"password"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
}

type UserResponseV1

type UserResponseV1 struct {
	ID        int64     `json:"id"`
	Username  string    `json:"username"`
	FirstName string    `json:"firstName"`
	LastName  string    `json:"lastName"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type WebService

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

WebService is the main entry to the APIs exposed by Blogzilla. In real world application we will collect several metrics such as each endpoints request/response latency, counter etc.

func NewWebService

func NewWebService(conf *config.Config, authManager *usecases.AuthManager, userManager *usecases.UserManager, blogManager *usecases.BlogManager) *WebService

func (*WebService) Start

func (ws *WebService) Start() error

Jump to

Keyboard shortcuts

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