Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ErrMsgNotFound is the error message for when a resource is not found ErrMsgNotFound = "not found" // ErrMsgSaveFailed is the error message for when a save operation fails ErrMsgSaveFailed = "save failed" )
Variables ¶
View Source
var ( // ErrNotFound is an error for when a resource is not found ErrNotFound = errors.New(ErrMsgNotFound) // ErrSaveFailed is an error for when a save operation fails ErrSaveFailed = errors.New(ErrMsgSaveFailed) )
Functions ¶
This section is empty.
Types ¶
type GrpcServer ¶
type GrpcServer interface { // Serve starts the gRPC server // - net.Listener: the listener to bind the server to // returns an error if the server fails to start Serve(net.Listener) error // GracefulStop stops the gRPC server gracefully GracefulStop() }
GrpcServer is an interface for gRPC server
type IConfig ¶
type IConfig interface { // GetDatabasePath returns the database path GetDatabasePath() string GetServerAddress() string GetServerPort() uint16 GetServerCert() string GetServerKey() string GetServerCA() string IsTLSEnabled() bool }
IConfig is an interface for configuration
type INumberRepository ¶
type INumberRepository interface { // Save saves a number // - number: the number to save // Returns an error if the save operation fails Save(number Number) error // FindByID finds a number by its ID // - id: the ID of the number to find // Returns the number if found, otherwise returns an error FindByID(id string) (*Number, error) // DeleteByID deletes a number by its ID // - id: the ID of the number to delete // Returns an error if the delete operation fails DeleteByID(id string) error }
INumberRepository is an interface for number repositories
Click to show internal directories.
Click to hide internal directories.