Code Monkey home page Code Monkey logo

goalert's Introduction

goalert

goalert is a Go package that allows users to display colorful alerts and messages on their terminal. It allows users to easily highlight important information or display error messages in a visually appealing way.

One of the key features of goalert is its support for different types of alerts, such as success, error, warning, and info. Each type of alert is displayed with a different color and style, making it easy for users to differentiate between them. The package also provides a set of default colors and styles for each type of alert, but users can easily customize them to suit their needs.

Using goalert is straightforward. Users simply need to import the package into their Go file and use the functions to display an alert. They can specify the type of alert they want to display, and goalert will take care of formatting and displaying the alert with the appropriate color and style.

Contributions to goalert are welcome, whether it's reporting issues, suggesting improvements, or submitting pull requests. The project is open-source and licensed under the MIT License, which means users are free to use, modify, and distribute it.

Overall, goalert provides a simple and flexible solution for displaying alerts and messages on the terminal in a visually appealing way. Its easy integration and customization options make it a valuable tool for Go developers who want to enhance the user experience of their command-line applications.

Features

  • Display alerts and messages with different colors and styles
  • Supports various types of alerts, such as success, error, warning, and info
  • Customizable colors and styles for each type of alert
  • Easy to use and integrate into your Go projects
  • Colorize text.

Installation

  1. To install goalert, you need to have Go installed and set up on your machine.
  2. Then, run the following command:
go get -u github.com/dev-bittu/goalert

Usage

Import the goalert package into your Go file:

import (
  alert "github.com/dev-bittu/goalert/v1"
)

Displaying Alerts

You can display alerts using the different-different function. Here's an example:

package main

import (
  alert "github.com/dev-bittu/goalert/v1"
)

func main() {
  alert.Success("Program compiled... :)")
}

Available Alert Types

  • alert.Success : Success alert
func Success(text string) {}
  • alert.Error : Error alert
func Error(text string) {}
  • alert.Warn : Warning alert
func Warn(text string) {}
  • alert.Info : Information alert
func Info(text string) {}
  • alert.Impo : Important alert
func Impo(text string) {}

Example

package main

import(
  alert "github.com/dev-bittu/goalert/v1"
)

func main() {
  alert.Error("Error while compiling...:(")
  alert.Success("Compiled successfully...:)")
  alert.Warn("Warnings while compiling...!")
  alert.Info("Compiling....")
  alert.Impo("You are using depreciated package...")
}

Example's Screenshot

Displaying Colorful Text

You can display colorful text using the different-different function. Here's an example:

package main

import (
  "fmt"
  alert "github.com/dev-bittu/goalert/v1"
)

func main() {
  text := alert.Green("Program compiled... :)")
  fmt.Println(text)
}

Available Alert Types

  • alert.Success : Success alert
func Success(text string) string {}
  • alert.Error : Error alert
func Error(text string) string {}
  • alert.Warn : Warning alert
func Warn(text string) string {}
  • alert.Info : Information alert
func Info(text string) string {}
  • alert.Impo : Important alert
func Impo(text string) string {}

Example

package main

import(
  "fmt"
  alert "github.com/dev-bittu/goalert/v1"
)

func main() {
  fmt.Println(alert.Red("Error while compiling...:("))
  fmt.Println(alert.Green("Compiled successfully...:)"))
  fmt.Println(alert.Cyan("Warnings while compiling...!"))
  fmt.Println(alert.Blue("Compiling...."))
  fmt.Println(alert.Yellow("You are using depreciated package..."))
}

Example's Screenshot

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

goalert's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.