handlers

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallbackHandler

func CallbackHandler(w http.ResponseWriter, r *http.Request)

func GenerateLoginHandler

func GenerateLoginHandler(w http.ResponseWriter, r *http.Request)

func HealthCheckHandler

func HealthCheckHandler(w http.ResponseWriter, r *http.Request)
func RichHyperLink(s string) *dfcx.RichContents

Types

type GenerateLoginHandle

type GenerateLoginHandle struct {
	*RedisStateManager
}

func NewGenerateLoginHandle

func NewGenerateLoginHandle(c *redis.Client) *GenerateLoginHandle

func (*GenerateLoginHandle) Init

func (h *GenerateLoginHandle) Init(c *redis.Client)

func (*GenerateLoginHandle) ServeHTTP

func (h *GenerateLoginHandle) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RedisStateManager

type RedisStateManager struct {
	Client *redis.Client
	State  *State
}

func NewRedisStateManager

func NewRedisStateManager(c *redis.Client) *RedisStateManager

func (*RedisStateManager) FromRequest

func (rsm *RedisStateManager) FromRequest(r *http.Request) (*dfcx.WebhookRequest, error)

func (*RedisStateManager) GetKey

func (rsm *RedisStateManager) GetKey(ctx context.Context) error

func (*RedisStateManager) SetKey

func (rsm *RedisStateManager) SetKey(ctx context.Context) error

type State

type State struct {
	Session     string `json:"session"`
	SessionId   string `json:"sessionId,omitempty"`
	AccessToken string `json:"accessToken,omitempty"`
}

func (*State) MarshalBinary

func (s *State) MarshalBinary() ([]byte, error)

func (*State) SetSessionId

func (s *State) SetSessionId(r *dfcx.WebhookRequest) error

func (*State) UnmarshalBinary

func (s *State) UnmarshalBinary(data []byte) error

func (*State) UnmarshalString

func (s *State) UnmarshalString(data string) error

Jump to

Keyboard shortcuts

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