gcontacts

package
v0.0.0-...-9625bed Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: GPL-3.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Id                  string                `xml:"id"`
	Name                Name                  `xml:"name"`
	PhoneNumbers        []PhoneNumber         `xml:"phoneNumber"`
	GroupMembershipInfo []GroupMembershipInfo `xml:"groupMembershipInfo"`
	Links               []Link                `xml:"link"`
}

type Feed

type Feed struct {
	Entries []Entry `xml:"entry"`
}

type Gcontacts

type Gcontacts struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context) (*Gcontacts, error)

func NewWithCustomConfig

func NewWithCustomConfig(ctx context.Context, config string) (*Gcontacts, error)

func (*Gcontacts) AddContact

func (s *Gcontacts) AddContact(ctx context.Context, body string) error

TODO: maybe use Entry struct instead of string.

func (*Gcontacts) ListContacts

func (s *Gcontacts) ListContacts(ctx context.Context) (*Feed, error)

func (*Gcontacts) RemoveContact

func (s *Gcontacts) RemoveContact(ctx context.Context, deleteUrl string) error

TODO: maybe use Entry struct instead of delete url

type GroupMembershipInfo

type GroupMembershipInfo struct {
	Deleted string `xml:"deleted,attr"`
	Href    string `xml:"href,attr"`
}
type Link struct {
	Rel  string `xml:"rel,attr,omitempty"`
	Type string `xml:"type,attr"`
	Href string `xml:"href,attr"`
}

type Name

type Name struct {
	GivenName  string `xml:"givenName"`
	FamilyName string `xml:"familyName"`
}

type PhoneNumber

type PhoneNumber struct {
	Value string `xml:",chardata"`
}

Jump to

Keyboard shortcuts

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