tableau

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(accessToken string, siteId string, baseUrl string, userId string, httpClient *http.Client) *Client

func (*Client) AddUserToGroup added in v0.0.2

func (c *Client) AddUserToGroup(ctx context.Context, groupId, userId string) error

AddUserToGroup adds user to a group.

func (*Client) GetGroupUsers

func (c *Client) GetGroupUsers(ctx context.Context, groupId string, pageSize int, pageNumber int) ([]User, Pagination, error)

GetGroupUsers returns all users in a group.

func (*Client) GetGroups

func (c *Client) GetGroups(ctx context.Context, pageSize int, pageNumber int) ([]Group, Pagination, error)

GetGroups returns all groups on site.

func (*Client) GetPaginatedGroupUsers

func (c *Client) GetPaginatedGroupUsers(ctx context.Context, groupId string) ([]User, error)

GetPaginatedGroupUsers returns all users in a group - paginated.

func (*Client) GetPaginatedGroups

func (c *Client) GetPaginatedGroups(ctx context.Context) ([]Group, error)

GetPaginatedGroups returns all groups - paginated.

func (*Client) GetPaginatedUsers

func (c *Client) GetPaginatedUsers(ctx context.Context) ([]User, error)

GetPaginatedUsers returns all users - paginated.

func (*Client) GetSite

func (c *Client) GetSite(ctx context.Context) (Site, error)

GetSite returns site details of the site user is logged in to.

func (*Client) GetUsers

func (c *Client) GetUsers(ctx context.Context, pageSize int, pageNumber int) ([]User, Pagination, error)

GetUsers returns all users on site.

func (*Client) RemoveUserFromGroup added in v0.0.2

func (c *Client) RemoveUserFromGroup(ctx context.Context, groupId, userId string) error

RemoveUserFromGroup removes user from a group.

func (*Client) VerifyUser

func (c *Client) VerifyUser(ctx context.Context) error

VerifyUser returns current logged in user.

type Credentials

type Credentials struct {
	Site                      Site   `json:"site"`
	User                      User   `json:"user"`
	Token                     string `json:"token"`
	EstimatedTimeToExpiration string `json:"estimatedTimeToExpiration"`
}

func Login

func Login(ctx context.Context, baseUrl string, contentUrl string, token string, tokenName string) (Credentials, error)

Login returns credentials needed to use the API.

type Group

type Group struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Pagination

type Pagination struct {
	PageNumber     string `json:"pageNumber"`
	PageSize       string `json:"pageSize"`
	TotalAvailable string `json:"totalAvailable"`
}

type Site

type Site struct {
	ID         string `json:"id"`
	ContentURL string `json:"contentUrl"`
	Name       string `json:"name"`
}

type User

type User struct {
	Email    string `json:"email"`
	ID       string `json:"id"`
	FullName string `json:"fullName"`
	Name     string `json:"name"`
	SiteRole string `json:"siteRole"`
}

Jump to

Keyboard shortcuts

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