server

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

package handler provide RESTFul interfaces for all database tables

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Enabled bool
	Secret  string
}

func (AuthConfig) String

func (c AuthConfig) String() string

type Config

type Config struct {
	DB   DBConfig
	Auth AuthConfig
	Cors CorsConfig
}

func (Config) String

func (c Config) String() string

type CorsConfig added in v0.2.0

type CorsConfig struct {
	Enabled bool
	Origins []string
}

func (CorsConfig) String added in v0.2.0

func (c CorsConfig) String() string

type DBConfig

type DBConfig struct {
	URL string
}

func (DBConfig) String

func (c DBConfig) String() string

type Option

type Option func(*Server)

func EnableAuth

func EnableAuth(enabled bool) Option

func Prefix

func Prefix(prefix string) Option

type Server

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

Server is the representation of a restful server which handles CRUD requests

func New

func New(dbConfig *DBConfig, options ...Option) *Server

New returns a Handler pointer

func (*Server) Close

func (s *Server) Close()

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type UserAuthInfo

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

Jump to

Keyboard shortcuts

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