google

package
v6.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleMember  = "MEMBER"
	RoleOwner   = "OWNER"
	RoleManager = "MANAGER"
)
View Source
const DefaultBatchDelaySeconds = 3
View Source
const DefaultBatchSize = 10
View Source
const DefaultSheetName = "Sheet1"
View Source
const MaxQuerySize = 10000

Variables

This section is empty.

Functions

func NewGoogleContactsDestination

func NewGoogleContactsDestination(destinationConfig internal.DestinationConfig) (internal.Destination,
	error,
)

NewGoogleContactsDestination creates a new GoogleContacts instance

func NewGoogleGroupsDestination

func NewGoogleGroupsDestination(destinationConfig internal.DestinationConfig) (internal.Destination, error)

func NewGoogleSheetsDestination

func NewGoogleSheetsDestination(destinationConfig internal.DestinationConfig) (internal.Destination, error)

func NewGoogleSheetsSource

func NewGoogleSheetsSource(sourceConfig internal.SourceConfig) (internal.Source, error)

func NewGoogleUsersDestination

func NewGoogleUsersDestination(destinationConfig internal.DestinationConfig) (internal.Destination, error)

Types

type Contact

type Contact struct {
	XMLName      xml.Name      `xml:"entry"`
	ID           string        `xml:"id"`
	Links        []Link        `xml:"link"`
	Etag         string        `xml:"etag,attr"`
	Title        string        `xml:"title"`
	Name         Name          `xml:"name"`
	Emails       []Email       `xml:"email"`
	PhoneNumbers []PhoneNumber `xml:"phoneNumber"`
	Organization Organization  `xml:"organization"`
	Where        Where         `xml:"where"`
	Notes        string        `xml:"content"`
}

type Email

type Email struct {
	XMLName xml.Name `xml:"email"`
	Primary bool     `xml:"primary,attr"`
	Address string   `xml:"address,attr"`
}

type Entries

type Entries struct {
	XMLName xml.Name  `xml:"feed"`
	Entries []Contact `xml:"entry"`
	Total   int       `xml:"totalResults"`
}

type GoogleAuth

type GoogleAuth struct {
	Type                    string `json:"type"`
	ProjectID               string `json:"project_id"`
	PrivateKeyID            string `json:"private_key_id"`
	PrivateKey              string `json:"private_key"`
	ClientEmail             string `json:"client_email"`
	ClientID                string `json:"client_id"`
	AuthURI                 string `json:"auth_uri"`
	TokenURI                string `json:"token_uri"`
	AuthProviderX509CertURL string `json:"auth_provider_x509_cert_url"`
	ClientX509CertURL       string `json:"client_x509_cert_url"`
}

type GoogleConfig

type GoogleConfig struct {
	DelegatedAdminEmail string
	Domain              string
	GoogleAuth          GoogleAuth
}

type GoogleContacts

type GoogleContacts struct {
	BatchSize         int
	BatchDelaySeconds int
	DestinationConfig internal.DestinationConfig
	GoogleConfig      GoogleConfig
	Client            http.Client
}

func (*GoogleContacts) ApplyChangeSet

func (g *GoogleContacts) ApplyChangeSet(
	changes internal.ChangeSet,
	eventLog chan<- internal.EventLogItem,
) internal.ChangeResults

ApplyChangeSet executes all of the configured sync tasks (create, update, and/or delete)

func (*GoogleContacts) ForSet

func (g *GoogleContacts) ForSet(syncSetJson json.RawMessage) error

ForSet is not implemented for this destination. Only one sync set may be defined in config.json.

func (*GoogleContacts) ListUsers

func (g *GoogleContacts) ListUsers(desiredAttrs []string) ([]internal.Person, error)

ListUsers returns all users (contacts) in the destination

type GoogleGroups

type GoogleGroups struct {
	DestinationConfig internal.DestinationConfig
	GoogleConfig      GoogleConfig
	AdminService      admin.Service
	GroupSyncSet      GroupSyncSet
	BatchSize         int
	BatchDelaySeconds int
}

func (*GoogleGroups) ApplyChangeSet

func (g *GoogleGroups) ApplyChangeSet(
	changes internal.ChangeSet,
	eventLog chan<- internal.EventLogItem,
) internal.ChangeResults

func (*GoogleGroups) ForSet

func (g *GoogleGroups) ForSet(syncSetJson json.RawMessage) error

func (*GoogleGroups) ListUsers

func (g *GoogleGroups) ListUsers(desiredAttrs []string) ([]internal.Person, error)

type GoogleSheets

type GoogleSheets struct {
	DestinationConfig internal.DestinationConfig
	SourceConfig      internal.SourceConfig
	GoogleConfig      GoogleConfig
	Service           *sheets.Service
	SheetsSyncSet     SheetsSyncSet
}

func (*GoogleSheets) ApplyChangeSet

func (g *GoogleSheets) ApplyChangeSet(
	changes internal.ChangeSet,
	eventLog chan<- internal.EventLogItem,
) internal.ChangeResults

func (*GoogleSheets) ForSet

func (g *GoogleSheets) ForSet(syncSetJson json.RawMessage) error

func (*GoogleSheets) ListUsers

func (g *GoogleSheets) ListUsers(desiredAttrs []string) ([]internal.Person, error)

type GoogleUsers

type GoogleUsers struct {
	DestinationConfig internal.DestinationConfig
	BatchSize         int
	BatchDelaySeconds int
	GoogleConfig      GoogleConfig
	AdminService      admin.Service
}

func (*GoogleUsers) ApplyChangeSet

func (g *GoogleUsers) ApplyChangeSet(
	changes internal.ChangeSet,
	eventLog chan<- internal.EventLogItem,
) internal.ChangeResults

func (*GoogleUsers) ForSet

func (g *GoogleUsers) ForSet(syncSetJson json.RawMessage) error

func (*GoogleUsers) ListUsers

func (g *GoogleUsers) ListUsers(desiredAttrs []string) ([]internal.Person, error)

type GroupSyncSet

type GroupSyncSet struct {
	GroupEmail    string
	Owners        []string
	ExtraOwners   []string
	Managers      []string
	ExtraManagers []string
	ExtraMembers  []string
	DisableAdd    bool
	DisableUpdate bool
	DisableDelete bool
}
type Link struct {
	XMLName xml.Name `xml:"link"`
	Rel     string   `xml:"rel,attr"`
	Href    string   `xml:"href,attr"`
}

type Name

type Name struct {
	XMLName    xml.Name `xml:"name"`
	FullName   string   `xml:"fullName"`
	GivenName  string   `xml:"givenName"`
	FamilyName string   `xml:"familyName"`
}

type Organization

type Organization struct {
	XMLName        xml.Name `xml:"organization"`
	Name           string   `xml:"orgName"`
	Title          string   `xml:"orgTitle"`
	JobDescription string   `xml:"orgJobDescription"`
	Department     string   `xml:"orgDepartment"`
}

type PhoneNumber

type PhoneNumber struct {
	XMLName xml.Name `xml:"phoneNumber"`
	Rel     string   `xml:"rel,attr"`
	Label   string   `xml:"label,attr"`
	Primary bool     `xml:"primary,attr"`
	Value   string   `xml:",chardata"`
}

type SheetsSyncSet

type SheetsSyncSet struct {
	SheetID          string
	SheetName        string
	CompareAttribute string
}

type Where

type Where struct {
	XMLName     xml.Name `xml:"where"`
	ValueString string   `xml:"valueString,attr"`
}

Jump to

Keyboard shortcuts

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