store

package
v0.0.0-...-be8e6cd Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2017 License: MIT Imports: 0 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	// The unique identifier of this contact.
	// omitempty hides this field when exporting to json. Because it is common for json
	// to be lowercase, we additionally define `json:"id"` to tell the "exporter" that this
	// field should be called id, not ID.
	ID string `json:"id,omitempty" db:"id"`

	// Name is the contact's full name.
	Name string `json:"name" db:"name"`

	// Department is the contact's department in a company.
	Department string `json:"department" db:"department"`

	// Company is the name of the company the contact works for.
	Company string `json:"company" db:"company"`
}

Contact defines the structure of a contact which including name, department and company.

type ContactStorer

type ContactStorer interface {
	FetchContacts() (Contacts, error)
	GetContact(id string) (*Contact, error)
	DeleteContact(id string) error
	CreateContact(*Contact) error
	UpdateContact(*Contact) error
}

type Contacts

type Contacts map[string]*Contact

Contacts is a list of contacts.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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