morse

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: BSD-3-Clause Imports: 3 Imported by: 14

README

morse

Go Report Card CircleCI codecov Documentation License

Morse Code Library in Go

Download and Use

go get -u -v github.com/alwindoss/morse

or

dep ensure -add github.com/alwindoss/morse

Sample Usage

package main

import (
	"fmt"
	"strings"

	"github.com/alwindoss/morse"
)

func main() {
	h := morse.NewHacker()
	morseCode, err := h.Encode(strings.NewReader("Convert this to Morse"))
	if err != nil {
		return
	}
	// Morse Code is: -.-. --- ...- . .-. - / - .... .. ... / - --- / -- --- .-. ... .
	fmt.Printf("Morse Code is: %s\n", string(morseCode))
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder interface {
	Decode(io.Reader) ([]byte, error)
}

Decoder is an interface that specifies function to Encode

type Encoder

type Encoder interface {
	Encode(io.Reader) ([]byte, error)
}

Encoder is an interface that specifies function to Encode

type Hacker

type Hacker interface {
	Encoder
	Decoder
}

Hacker is an interface that composes Encoder and Decoder

func NewHacker

func NewHacker() Hacker

NewHacker is a factory function that generates a Morse Hacker Client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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