setup

package
v0.0.0-...-539540d Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthInterceptor

func AuthInterceptor(keyFunc func(kid string) *ecdsa.PublicKey) grpc.UnaryServerInterceptor

Types

type AccessTokenClaims

type AccessTokenClaims struct {
	jwt.RegisteredClaims
	Type     string `json:"type"`
	FullName string `json:"full_name"`
}

func GetAccessTokenClaims

func GetAccessTokenClaims(ctx context.Context) (*AccessTokenClaims, bool)

type BearerTokenAuth

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

func NewBearerTokenAuth

func NewBearerTokenAuth(renew func(ctx context.Context) (string, error)) (*BearerTokenAuth, error)

func (*BearerTokenAuth) GetRequestMetadata

func (b *BearerTokenAuth) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

func (*BearerTokenAuth) RequireTransportSecurity

func (b *BearerTokenAuth) RequireTransportSecurity() bool

type Job

type Job interface {
	Run(ctx context.Context) error
}

type JobFunc

type JobFunc func(ctx context.Context) error

func (JobFunc) Run

func (fn JobFunc) Run(ctx context.Context) error

type JobSpec

type JobSpec struct {
	Name      string
	Job       Job
	Interval  time.Duration
	Immediate bool
}

type RefreshTokenClaims

type RefreshTokenClaims struct {
	jwt.RegisteredClaims
	Type      string           `json:"type"`
	LoginTime *jwt.NumericDate `json:"login_time"`
}

type Server

type Server struct {
	HTTPPort        int
	GRPCPort        int
	Logger          *slog.Logger
	Register        func(*grpc.Server, *grpc.ClientConn, *runtime.ServeMux) error
	Jobs            []JobSpec
	Cors            *cors.Options
	ServeMuxOptions []runtime.ServeMuxOption

	DisableAuthentication bool
	KeyFunc               func(kid string) *ecdsa.PublicKey
}

func (*Server) Run

func (s *Server) Run() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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