pipe

package
v0.0.0-...-8c04c50 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg *config.Config, auth auth.Auth) error

Types

type Frontend

type Frontend struct {
	GroupValid      auth.PipeGroupValid
	Addr            string
	Auth            auth.Auth
	Session         *Session
	Wait            *sync.WaitGroup
	BackendHostName string
	BackendProxy    *fasthttp.HostClient
	BackendTimeout  time.Duration
}

func (*Frontend) Serve

func (frontend *Frontend) Serve()

func (*Frontend) SoftRedirect

func (frontend *Frontend) SoftRedirect(ctx *fasthttp.RequestCtx) auth.SoftRedirect

SoftRedirect perform a redirect handle by javascript code

type Pipe

type Pipe interface {
	Serve(auth auth.Auth, bc config.BackendConfig)
}

type Session

type Session struct {
	Cookie *securecookie.SecureCookie
	Config *config.SessionConfig
}

func NewSession

func NewSession(cfg config.SessionConfig) (*Session, error)

func (*Session) Store

func (session *Session) Store(ctx *fasthttp.RequestCtx) *SessionStore

type SessionStore

type SessionStore struct {
	Cookie *securecookie.SecureCookie
	Ctx    *fasthttp.RequestCtx
	Config *config.SessionConfig
	Stored bool
	// contains filtered or unexported fields
}

func (*SessionStore) Delete

func (store *SessionStore) Delete(key string)

func (*SessionStore) Expired

func (store *SessionStore) Expired(last int64) bool

func (*SessionStore) Get

func (store *SessionStore) Get(key string) string

Get string value from session store

func (*SessionStore) GetInt

func (store *SessionStore) GetInt(key string) int64

GetInt int value from session store

func (*SessionStore) Init

func (store *SessionStore) Init()

Init session store from cookie

func (*SessionStore) Save

func (store *SessionStore) Save()

func (*SessionStore) Set

func (store *SessionStore) Set(key string, value string)

func (*SessionStore) SetInt

func (store *SessionStore) SetInt(key string, value int64)

Jump to

Keyboard shortcuts

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