usercenter

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Name is the name of the compiled software.
	Name = "onex-usercenter"

	ID, _ = os.Hostname()

	Version = version.Get().String()
)

Functions

func InitializeWebServer

func InitializeWebServer(arg <-chan struct{}, config *Config, mySQLOptions *db.MySQLOptions, jwtOptions *options.JWTOptions, redisOptions *options.RedisOptions, kafkaOptions *options.KafkaOptions) (server.Server, error)

func NewAuthenticator

func NewAuthenticator(jwtOpts *genericoptions.JWTOptions, redisOpts *genericoptions.RedisOptions) (authn.Authenticator, error)

NewAuthenticator creates a new JWT-based Authenticator using the provided JWT and Redis options.

func NewWebServer

func NewWebServer(serverConfig *ServerConfig) (server.Server, error)

NewWebServer creates and configures a new core web server.

func NewWhiteListMatcher

func NewWhiteListMatcher() selector.MatchFunc

func ProvideKratosAppConfig

func ProvideKratosAppConfig(registrar registry.Registrar) server.KratosAppConfig

func ProvideKratosLogger

func ProvideKratosLogger() krtlog.Logger

Types

type Config

type Config struct {
	GRPCOptions   *genericoptions.GRPCOptions
	HTTPOptions   *genericoptions.HTTPOptions
	TLSOptions    *genericoptions.TLSOptions
	JWTOptions    *genericoptions.JWTOptions
	MySQLOptions  *genericoptions.MySQLOptions
	RedisOptions  *genericoptions.RedisOptions
	EtcdOptions   *genericoptions.EtcdOptions
	KafkaOptions  *genericoptions.KafkaOptions
	JaegerOptions *genericoptions.JaegerOptions
	ConsulOptions *genericoptions.ConsulOptions
}

Config contains application-related configurations.

func (*Config) NewServer

func (cfg *Config) NewServer(ctx context.Context) (*Server, error)

NewServer initializes and returns a new Server instance.

type Server

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

Server represents the web server.

func (*Server) Run

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

Run starts the server and listens for termination signals. It gracefully shuts down the server upon receiving a termination signal.

type ServerConfig

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

ServerConfig contains the core dependencies and configurations of the server.

func (*ServerConfig) NewGRPCServer

func (c *ServerConfig) NewGRPCServer() *grpc.Server

NewGRPCServer creates and configures a new gRPC server instance.

func (*ServerConfig) NewHTTPServer

func (c *ServerConfig) NewHTTPServer() *http.Server

NewHTTPServer creates and configures a new HTTP server instance.

Directories

Path Synopsis
biz
Package biz is the place where you can implements more complex business logic.
Package biz is the place where you can implements more complex business logic.
pkg
nolint: dupl
nolint: dupl

Jump to

Keyboard shortcuts

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