gateway

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(next http.Handler) http.Handler

Middleware adds request to context

Types

type Modifier

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

Modifier defines a store to save session

func (*Modifier) MetadataAnnotator

func (m *Modifier) MetadataAnnotator(_ context.Context, r *http.Request) metadata.MD

MetadataAnnotator looks up session and passes session data and jwt token to gRPC method

func (*Modifier) Modifier

func (m *Modifier) Modifier(ctx context.Context, w http.ResponseWriter, resp proto.Message) error

Modifier checks whether the gRPC method called has requested for changing the response before the http response is sent

type Session

type Session struct {
	// User ID
	UserID int
	// CSRF token for the session
	CSRFToken []byte
	// User role
	Role string
}

Session is the structure holding session data that gorilla's session store will convert into a cookie.

Jump to

Keyboard shortcuts

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