Documentation ¶
Index ¶
- type Server
- func (s *Server) CreateCredential(ctx context.Context, in *shinninjou.Credential) (*shinninjou.CredentialResponse, error)
- func (s *Server) RegisterServer(srv *ggrpc.Server)
- func (s *Server) StartServer()
- func (s *Server) ValidateCredential(ctx context.Context, in *shinninjou.Credential) (response *shinninjou.CredentialResponse, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { *grpc.Server shinninjou.ShinninjouServer }
Server defines the structure of a server for the Shinninjou service.
func NewServer ¶
func NewServer(config *service.ServerConfig) *Server
NewServer returns a new gRPC server for the Shinninjou service.
func (*Server) CreateCredential ¶
func (s *Server) CreateCredential(ctx context.Context, in *shinninjou.Credential) (*shinninjou.CredentialResponse, error)
CreateCredential creates an authentication credential for the current user. If the credential is a password, a bcrypt hash is generated and stored.
func (*Server) RegisterServer ¶
RegisterServer registers the gRPC server as a Shinninjou service handler.
func (*Server) StartServer ¶
func (s *Server) StartServer()
StartServer initializes the MongoDB connection and database and starts the server.
func (*Server) ValidateCredential ¶
func (s *Server) ValidateCredential(ctx context.Context, in *shinninjou.Credential) (response *shinninjou.CredentialResponse, err error)
ValidateCredential validates the given credential against the stored record.
Click to show internal directories.
Click to hide internal directories.