book

package
v0.0.0-...-9a81cb1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package book provides all the core features of the address book : managing contacts

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	Contacts []*contact.Contact
}

Book structure represents the address book and its data

func New

func New() (book Book, err error)

New initializes a Book structure with all the contacts

func (*Book) CreateContact

func (book *Book) CreateContact(name string)

CreateContact add a new contact into the book

func (*Book) DeleteContact

func (book *Book) DeleteContact(index int)

DeleteContact removes a contact from the book

func (Book) ListAllContacts

func (book Book) ListAllContacts(withIndex bool) []string

ListAllContacts returns a list of all the contacts in a pretty way

func (Book) Save

func (book Book) Save() (err error)

Save writes the address book into the appropriate file

Jump to

Keyboard shortcuts

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