Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Maxim ¶
type Maxim struct {
// contains filtered or unexported fields
}
func Init ¶
func Init(c *MaximSDKConfig) *Maxim
Maxim is the main client for the Maxim SDK. It provides access to various Maxim features like logging. The client should be initialized with Init() and cleaned up with Cleanup().
Example usage:
config := &maxim.MaximSDKConfig{
ApiKey: "your-api-key",
Debug: true,
}
client := maxim.Init(config)
defer client.Cleanup()
// Now you can use the client to access Maxim features
logger, err := client.GetLogger(&logging.LoggerConfig{
Id: "your-log-repo-id",
})
func (*Maxim) Cleanup ¶
func (m *Maxim) Cleanup()
Cleanup Maxim SDK state and flushes all logs in all the loggers. It should be called when the application is shutting down to ensure all logs are sent to the server.
Example usage:
config := &maxim.MaximSDKConfig{
ApiKey: "your-api-key",
Debug: true,
}
client := maxim.Init(config)
defer client.Cleanup() // This ensures all logs are flushed before the application exits
func (*Maxim) GetLogger ¶
GetLogger returns a logger instance for the given configuration. It inherits the authentication and debug from Maxim instance.
Example usage:
config := &maxim.MaximSDKConfig{
ApiKey: "your-api-key",
Debug: true,
}
client := maxim.Init(config)
defer client.Cleanup()
logger, err := client.GetLogger(&logging.LoggerConfig{
Id: "your-log-repo-id",
})
if err != nil {
// handle error
}
The SDK automatically handles flushing logs when Cleanup() is called.
type MaximSDKConfig ¶
Click to show internal directories.
Click to hide internal directories.