server

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const MaxRSSItemCount = 100
View Source
const MaxRSSItemTitleLength = 100
View Source
const (
	MebiByte = 1024 * 1024
)

Variables

This section is empty.

Functions

func CheckResourceVisibility added in v0.13.2

func CheckResourceVisibility(ctx context.Context, s *store.Store, resourceID int) (store.Visibility, error)

func JWTMiddleware added in v0.12.0

func JWTMiddleware(server *Server, next echo.HandlerFunc, secret string) echo.HandlerFunc

JWTMiddleware validates the access token. If the access token is about to expire or has expired and the request has a valid refresh token, it will try to generate new access token and refresh token.

Types

type Claims added in v0.12.0

type Claims struct {
	Name string `json:"name"`
	jwt.RegisteredClaims
}

Claims creates a struct that will be encoded to a JWT. We add jwt.RegisteredClaims as an embedded type, to provide fields such as name.

type Server

type Server struct {
	ID      string
	Secret  string
	Profile *profile.Profile
	Store   *store.Store
	// contains filtered or unexported fields
}

func NewServer

func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store) (*Server, error)

func (*Server) GetEcho added in v0.13.0

func (s *Server) GetEcho() *echo.Echo

func (*Server) Shutdown added in v0.10.3

func (s *Server) Shutdown(ctx context.Context)

func (*Server) Start added in v0.10.3

func (s *Server) Start(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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