Documentation ¶
Index ¶
- Variables
- func Auth(store oauth2.TokenStore) func(http.Handler) http.Handler
- func Cors(pass http.Handler) http.Handler
- func DebugLog(pass http.Handler) http.Handler
- func EstablishContext(svr sparq.Server) func(http.Handler) http.Handler
- func HttpError(w http.ResponseWriter, err error, code int)
- func IsLoggedIn(r *http.Request) string
- func MultipartTestForm(filefield string, filename string, extrafields map[string]string) (bytes.Buffer, *multipart.Writer, error)
- func NewTestServer(t *testing.T, name string) (sparq.Server, func())
- func RegisterPages(pages ...string)
- func Render(w http.ResponseWriter, r *http.Request, page string, custom any)
- func RequireLogin(fn http.HandlerFunc) http.HandlerFunc
- func RootRouter(s sparq.Server) *mux.Router
- type ContextType
- type PageData
- type SqliteOauthStore
- func (scs *SqliteOauthStore) Create(ctx context.Context, info oauth2.TokenInfo) error
- func (scs *SqliteOauthStore) Delete(ctx context.Context, id string) error
- func (scs *SqliteOauthStore) GetByAccess(ctx context.Context, access string) (oauth2.TokenInfo, error)
- func (scs *SqliteOauthStore) GetByCode(ctx context.Context, code string) (oauth2.TokenInfo, error)
- func (scs *SqliteOauthStore) GetByID(ctx context.Context, id string) (oauth2.ClientInfo, error)
- func (scs *SqliteOauthStore) GetByRefresh(ctx context.Context, refresh string) (oauth2.TokenInfo, error)
- func (scs *SqliteOauthStore) RemoveByAccess(ctx context.Context, access string) error
- func (scs *SqliteOauthStore) RemoveByCode(ctx context.Context, code string) error
- func (scs *SqliteOauthStore) RemoveByRefresh(ctx context.Context, refresh string) error
- func (scs *SqliteOauthStore) Set(ctx context.Context, id string, cli oauth2.ClientInfo) error
- type WebCtx
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Anonymous string = "" HelperKey ContextType = 7 // openssl rand -hex 32 // ruby -rsecurerandom -e "puts SecureRandom.hex(32)" SessionStore = sessions.NewCookieStore([]byte(os.Getenv("SESSION_KEY"))) )
View Source
var (
AssetLookups = []assetLookup{
localeFiles.ReadFile,
}
)
Functions ¶
func IsLoggedIn ¶
func MultipartTestForm ¶
func RegisterPages ¶
func RegisterPages(pages ...string)
func RequireLogin ¶
func RequireLogin(fn http.HandlerFunc) http.HandlerFunc
Types ¶
type ContextType ¶
type ContextType int32
type PageData ¶
func (*PageData) CurrentAccount ¶
type SqliteOauthStore ¶
func IntegrateOauth ¶
func IntegrateOauth(s sparq.Server, root *mux.Router) *SqliteOauthStore
func (*SqliteOauthStore) Delete ¶
func (scs *SqliteOauthStore) Delete(ctx context.Context, id string) error
func (*SqliteOauthStore) GetByAccess ¶
func (*SqliteOauthStore) GetByID ¶
func (scs *SqliteOauthStore) GetByID(ctx context.Context, id string) (oauth2.ClientInfo, error)
func (*SqliteOauthStore) GetByRefresh ¶
func (*SqliteOauthStore) RemoveByAccess ¶
func (scs *SqliteOauthStore) RemoveByAccess(ctx context.Context, access string) error
func (*SqliteOauthStore) RemoveByCode ¶
func (scs *SqliteOauthStore) RemoveByCode(ctx context.Context, code string) error
func (*SqliteOauthStore) RemoveByRefresh ¶
func (scs *SqliteOauthStore) RemoveByRefresh(ctx context.Context, refresh string) error
func (*SqliteOauthStore) Set ¶
func (scs *SqliteOauthStore) Set(ctx context.Context, id string, cli oauth2.ClientInfo) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.