util

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2016 License: BSD-1-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package util defines a few commonly used utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Action

func Action(f string, argv ...interface{}) string

Action returns the given, formatted message as a user action. E.g.: /me <something something>

func Bold

func Bold(f string, argv ...interface{}) string

Bold returns the given value as bold text.

func Italic

func Italic(f string, argv ...interface{}) string

Italic returns the given value as italicized text.

func ReadFile

func ReadFile(file string, v interface{}, compressed bool) error

ReadFile loads the, optionally compressed, contents of the given file and unmarshals it into the specified value v.

This is a utility function which can be used by plugins to load custom configuration info or data from disk.

func Underline

func Underline(f string, argv ...interface{}) string

Underline returns the given value as underlined text.

func WriteFile

func WriteFile(file string, v interface{}, compressed bool) error

WriteFile writes the marshaled version of v to the given file. It is optionally gzip compressed.

This is a utility function which can be used by plugins to save custom configuration info or data to disk.

Types

This section is empty.

Jump to

Keyboard shortcuts

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