banner

package
v2.235.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package banner generates ASCII picture of the Berty logo with a message.

       /\
  /\  / /\  ______         Lorem ipsum dolor sit amet, consectetur
 / /\/ /  \/  |   \        adipiscing elit, sed do eiusmod tempor
| |  \/   | ()|    |   incididunt ut labore et dolore magna aliqua.
 \ \      |   |____|     Ut enim ad minim veniam, quis nostrud [...]
  \ \      \____/ __           __
   \/       /    / /  ___ ____/ /___ __
   /     __/    / _ \/ -_) __/ __/ // /
  /_____/      /____/\__/_/  \__/\__ /
 /__/                           /___/

Index

Examples

Constants

View Source

Variables

This section is empty.

Functions

func OfTheDay

func OfTheDay() string

OfTheDay returns the ascii-art representation of the Berty bird saying the quote of the day

Example
fmt.Println(OfTheDay())
Output:

func Say

func Say(message string) string

Say returns an ascii-art representation of the Berty bird saying something

Example
fmt.Println(Say("hello world!"))
Output:

          /\
     /\  / /\  ______
    / /\/ /  \/  |   \                     hello world!
   | |  \/   | ()|    |
    \ \      |   |____|
     \ \      \____/ __           __
      \/       /    / /  ___ ____/ /___ __
      /     __/    / _ \/ -_) __/ __/ // /
     /_____/      /____/\__/_/  \__/\__ /
    /__/                           /___/
Example (Long)
fmt.Println(Say(`Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.`))
Output:

          /\
     /\  / /\  ______         Lorem ipsum dolor sit amet, consectetur
    / /\/ /  \/  |   \        adipiscing elit, sed do eiusmod tempor
   | |  \/   | ()|    |   incididunt ut labore et dolore magna aliqua.
    \ \      |   |____|     Ut enim ad minim veniam, quis nostrud [...]
     \ \      \____/ __           __
      \/       /    / /  ___ ____/ /___ __
      /     __/    / _ \/ -_) __/ __/ // /
     /_____/      /____/\__/_/  \__/\__ /
    /__/                           /___/

Types

type Quote

type Quote struct {
	Author string
	Text   string
}

Quote is a data type that stores the text of the quote and its author

func QOTD

func QOTD() Quote

QOTD returns the quote of the day for display in banners or other graphics. This is calculated by using the number of days (24 hr periods) since a fixed time as the seed for a random number generator. This will result in the same quote being returned during a 24 hr period even after subsequent calls. UTC time is used by default if local time is not available.

BUG: The Go language cannot get local the local time on Android and iOS. This is a confirmed upstream issue, so mobile will always default to UTC.

func RandomQuote

func RandomQuote() Quote

RandomQuote returns a random quote from the quote list. For the quote of the day, use the function QOTD instead.

func (Quote) String

func (q Quote) String() string

Jump to

Keyboard shortcuts

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