server

package
v0.0.0-...-1e637f1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Code   int    `json:"code"`
	Status string `json:"status"`
	Reason string `json:"reason"`
}

APIError is returned when the API encounters an error. It implements the Error interface.

func (*APIError) Error

func (e *APIError) Error() string

type Comic

type Comic struct {
	HashID    string    `json:"hash_id"`
	Path      string    `json:"path"`
	Title     string    `json:"title"`
	CreatedAt time.Time `json:"created_at"`
}

Comic is a comic as defined by the API.

type Options

type Options struct {
	Addr string

	DB     *sql.DB
	Logger *zap.Logger
}

Options are configuration options for a Server.

type Server

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

Server is an API server.

func New

func New(o *Options) *Server

New creates a new server.

func (*Server) Start

func (s *Server) Start() error

Start starts the server.

Jump to

Keyboard shortcuts

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