deteco

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Services map[string]*Service
	// contains filtered or unexported fields
}

Conf :

func NewConf

func NewConf(confPath string, logger *zap.Logger) (*Conf, error)

NewConf :

func (*Conf) GetService

func (c *Conf) GetService(id string) (*Service, error)

GetService :

func (*Conf) LoadServices

func (c *Conf) LoadServices() error

LoadServices :

type Handler

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

Handler handlers

func NewHandler

func NewHandler(conf *Conf, freshness time.Duration, cache *ccache.Cache, cacheSize int64, logger *zap.Logger) (*Handler, error)

NewHandler :

func (*Handler) Auth

func (h *Handler) Auth() func(w http.ResponseWriter, r *http.Request)

Auth : Auth handler

func (*Handler) GetService

func (h *Handler) GetService(t string) (*Service, error)

GetService :

func (*Handler) Hello

func (h *Handler) Hello() func(w http.ResponseWriter, r *http.Request)

Hello : hello handler

func (*Handler) TryVerifyJWT

func (h *Handler) TryVerifyJWT(t string, pk *rsa.PublicKey) (*jwt.StandardClaims, error)

TryVerifyJWT :

func (*Handler) VerifyAuthHeader

func (h *Handler) VerifyAuthHeader(t string) (*Service, error)

VerifyAuthHeader verify auth header

func (*Handler) VerifyOriginURI

func (h *Handler) VerifyOriginURI(path string, service *Service) error

VerifyOriginURI :

type Service

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

Service :

type TomlConf

type TomlConf struct {
	Services []TomlService `toml:"services"`
}

TomlConf : root struct

type TomlService

type TomlService struct {
	ID         string   `toml:"id"`
	Paths      []string `toml:"paths"`
	PublicKeys []string `toml:"public_keys"`
}

TomlService : services for parse toml

Jump to

Keyboard shortcuts

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