restapi

package
v0.0.0-...-802933b Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Prod  = "production"
	Debug = "debug"
	Test  = "test"
)
View Source
const ApiEndpoint = "/api"
View Source
const CookieURLs = "myurls"
View Source
const LinkEndpoint = "/links"
View Source
const LoginEndpoint = "/login"
View Source
const SessionCookieName = "urlshortener-session"
View Source
const UserContextKey = "user-context"
View Source
const UserCookieURLs = "user-cookie-urls"
View Source
const UserEndpoint = "/users"
View Source
const UserIDContextKey = "userID"

Variables

View Source
var ErrNoSessionCookie = errors.New("no session cookie")
View Source
var ErrNoSessionCookieUrls = errors.New("no session cookie urls")

Functions

This section is empty.

Types

type Config

type Config struct {
	Address     string `env:"HOST_ADDR"`
	StoreType   string `env:"STORE_TYPE"`
	TokenSecret string `env:"TOKEN_SECRET"`
	Mode        string `env:"MODE"`
}

func NewConfig

func NewConfig() *Config

type CustomValidator

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

func (*CustomValidator) Validate

func (cv *CustomValidator) Validate(i interface{}) error

type Server

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

func New

func New(conf *Config) *Server

func (*Server) Start

func (s *Server) Start() error

Jump to

Keyboard shortcuts

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