google

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthClient

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

AuthClient is for authenticating with Google and optionally getting a token from the web interface interactively

func NewAuthClient

func NewAuthClient(logger *zap.Logger, credPath string, tokenPath string) (*AuthClient, error)

NewAuthClient creates a new AuthClient with the paths given

func (*AuthClient) GetClient

func (a *AuthClient) GetClient() (*http.Client, error)

GetClient will return the http.Client for the authenticated connection

func (*AuthClient) GetTokenFromWeb

func (a *AuthClient) GetTokenFromWeb() *oauth2.Token

GetTokenFromWeb will interactively get a token from Google

type Client

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

Client is the Google Apps for Domains Client

func (*Client) GetGroupMembers

func (c *Client) GetGroupMembers(g *admin.Group) (m []*admin.Member, err error)

GetGroupMembers will get the members of the group specified

func (*Client) GetGroups

func (c *Client) GetGroups() (g []*admin.Group, err error)

GetGroups will get the groups from Google's Admin API

func (*Client) GetUsers

func (c *Client) GetUsers() (u []*admin.User, err error)

GetUsers will get the users from Google's Admin API

type IClient

type IClient interface {
	GetUsers() ([]*admin.User, error)
	GetGroups() ([]*admin.Group, error)
	GetGroupMembers(*admin.Group) ([]*admin.Member, error)
}

IClient is the Interface for the Client

func NewClient

func NewClient(logger *zap.Logger, client *AuthClient) (IClient, error)

NewClient creates a new client for Google's Admin API

Jump to

Keyboard shortcuts

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