maxim

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: Apache-2.0 Imports: 5 Imported by: 2

README

Maxim Go Library

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StrPtr

func StrPtr(str string) *string

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

func (m *Maxim) GetLogger(c *logging.LoggerConfig) (*logging.Logger, error)

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

type MaximSDKConfig struct {
	BaseUrl *string
	ApiKey  string
	Debug   bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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