Skip to content

Releases: sk-pkg/notify

v0.1.3

29 Jul 00:56

Choose a tag to compare

Features

  • feat(lark): implement SetToken function and rename Token to GetToken
    • Added new SetToken function to allow setting access tokens for specific Lark Apps with expiration time
    • Renamed Token function to GetToken for better naming consistency and clarity
    • Enhanced token management capabilities with proper caching support
    • Updated related comments and error messages to reflect the API changes

Bug Fixes

  • fix(lark): assign potential error to existing error variable
    • Improved error handling by using existing 'err' variable instead of blank identifier
    • Enhanced code readability and maintainability by avoiding unnecessary variable declarations

Breaking Changes

  • The Token method has been renamed to GetToken . Please update your code accordingly.

What's Changed

This release focuses on improving the Lark notification module with better token management capabilities and code quality improvements. The new SetToken function provides more flexibility for managing access tokens, while the bug fix ensures better error handling practices throughout the codebase.

Notify v0.1.0

13 Aug 02:55

Choose a tag to compare

Release Highlights

  • Initial release of the Notify package
  • Unified interface for managing multiple notification channels
  • Support for Lark, DingTalk, WeChat, Email, Telegram, and Bark notifications
  • Configurable default channel and notification level
  • Message ID generation for tracking
  • Asynchronous message processing with graceful shutdown

Features

  • Multiple notification channels:
    • Lark
    • DingTalk
    • WeChat
    • Email
    • Telegram
    • Bark
  • Four notification levels: Info, Success, Error, and Warning
  • Flexible configuration options for each channel
  • Easy-to-use methods for sending notifications
  • Concurrent processing of notifications

Installation

go get github.com/sk-pkg/notify@v0.1.0

Quick Start

import "github.com/sk-pkg/notify"

manager, err := notify.New(
    notify.OptLarkConfig(lark.Config{Enabled: true}),
    notify.OptDefaultChannel(notify.LarkChan),
    notify.OptDefaultLevel(notify.InfoLevel),
)
if err != nil {
    // Handle error
}

msgID, err := manager.Info("recipient", "Hello", "World")
if err != nil {
    // Handle error
}

// Don't forget to close when done
defer manager.Close()

Documentation

For detailed usage and configuration options, please refer to the main README.

For Lark-specific documentation, see the Lark README.

License

This package is governed by a MIT style license. See the LICENSE file for details.

Feedback and Contributions

We welcome your feedback and contributions. Please open an issue or submit a pull request on our GitHub repository.