restgate: github.com/pjebs/restgate Index | Files

package restgate

import "github.com/pjebs/restgate"

Index

Package Files

restgate.go

type ALogger Uses

type ALogger interface {
    Printf(format string, v ...interface{})
}

type AuthenticationSource Uses

type AuthenticationSource int
const (
    Static   AuthenticationSource = 0
    Database                      = 1
)

type Config Uses

type Config struct {
    *sql.DB
    Key                     []string
    Secret                  []string //Can be "" but not recommended
    TableName               string
    ErrorMessages           map[int]map[string]string
    Context                 func(r *http.Request, authenticatedKey string)
    Debug                   bool
    Postgres                bool
    Logger                  ALogger
    HTTPSProtectionOff      bool //Default is HTTPS Protection On
    GAE_FlexibleEnvironment bool //Default is false. ALWAYS KEEP THIS FALSE UNLESS you are using Google App Engine-Flexible Environment
}

When AuthenticationSource=Static, Key(s)=Actual Key and Secret(s)=Actual Secret. When AuthenticationSource=Database, Key[0]=Key_Column and Secret[0]=Secret_Column.

type RESTGate Uses

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

func New Uses

func New(headerKeyLabel string, headerSecretLabel string, as AuthenticationSource, config Config) *RESTGate

func (*RESTGate) ServeHTTP Uses

func (self *RESTGate) ServeHTTP(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)

Package restgate imports 9 packages (graph) and is imported by 1 packages. Updated 2017-07-12. Refresh now. Tools for package owners.