client

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxPageSize = 250
	MinPageSize = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(ctx context.Context, dsn string) (*Client, error)

func (*Client) AddGroupMember added in v0.0.8

func (c *Client) AddGroupMember(ctx context.Context, groupID, userID int64, isAdmin bool) error

func (*Client) GetGroup

func (c *Client) GetGroup(ctx context.Context, groupID int64) (*GroupModel, error)

func (*Client) GetGroupFolderDefault

func (c *Client) GetGroupFolderDefault(ctx context.Context, groupID int64, folderID int64) (*GroupFolderDefault, error)

func (*Client) GetGroupMember added in v0.0.8

func (c *Client) GetGroupMember(ctx context.Context, groupID, userID int64) (*GroupMember, error)

func (*Client) GetGroupPage

func (c *Client) GetGroupPage(ctx context.Context, groupID int64, pageID int64) (*GroupPage, error)

func (*Client) GetGroupResource

func (c *Client) GetGroupResource(ctx context.Context, groupID int64, resourceID int64) (*GroupResource, error)

func (*Client) GetGroupResourceFolderDefault

func (c *Client) GetGroupResourceFolderDefault(ctx context.Context, groupID int64, folderID int64) (*GroupResourceFolderDefault, error)

func (*Client) GetPage

func (c *Client) GetPage(ctx context.Context, id int64) (*PageModel, error)

func (*Client) GetResource

func (c *Client) GetResource(ctx context.Context, id int64) (*ResourceModel, error)

func (*Client) ListGroupMembers

func (c *Client) ListGroupMembers(ctx context.Context, groupID int64, pager *Pager, skipDisabledUsers bool) ([]*GroupMember, string, error)

func (*Client) ListGroupsForOrg

func (c *Client) ListGroupsForOrg(ctx context.Context, orgID int64, pager *Pager) ([]*GroupModel, string, error)

func (*Client) ListOrganizations

func (c *Client) ListOrganizations(ctx context.Context, pager *Pager) ([]*OrgModel, string, error)

select id, domain, name, hostname, subdomain from organizations;.

func (*Client) ListPagesForOrg

func (c *Client) ListPagesForOrg(ctx context.Context, orgID int64, pager *Pager) ([]*PageModel, string, error)

func (*Client) ListResourcesForOrg

func (c *Client) ListResourcesForOrg(ctx context.Context, orgID int64, pager *Pager) ([]*ResourceModel, string, error)

func (*Client) ListUsersForOrg

func (c *Client) ListUsersForOrg(ctx context.Context, orgID int64, pager *Pager, skipDisabledUsers bool) ([]*UserModel, string, error)

func (*Client) RemoveGroupMember added in v0.0.8

func (c *Client) RemoveGroupMember(ctx context.Context, groupID, userID int64) error

func (*Client) UpdateGroupMember added in v0.0.8

func (c *Client) UpdateGroupMember(ctx context.Context, groupID, userID int64, isAdmin bool) (*GroupMember, error)

func (*Client) ValidateConnection

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

type GroupFolderDefault

type GroupFolderDefault struct {
	ID          int64  `db:"id"`
	AccessLevel string `db:"accessLevel"`
}

type GroupMember

type GroupMember struct {
	Id      int64  `db:"id"`
	UserID  *int64 `db:"userId"`
	GroupID *int64 `db:"groupId"`
	IsAdmin bool   `db:"isAdmin"`
	Enabled bool   `db:"enabled"`
}

func (*GroupMember) GetGroupID

func (g *GroupMember) GetGroupID() int64

func (*GroupMember) GetUserID

func (g *GroupMember) GetUserID() int64

type GroupModel

type GroupModel struct {
	ID                          int64   `db:"id"`
	Name                        *string `db:"name"`
	OrganizationID              *int64  `db:"organizationId"`
	UniversalAccess             string  `db:"universalAccess"`
	UniversalResourceAccess     string  `db:"universalResourceAccess"`
	UniversalQueryLibraryAccess string  `db:"universalQueryLibraryAccess"`
	UserListAccess              bool    `db:"userListAccess"`
	AuditLogAccess              bool    `db:"auditLogAccess"`
	UnpublishedReleaseAccess    bool    `db:"unpublishedReleaseAccess"`
}

func (*GroupModel) GetName

func (g *GroupModel) GetName() string

func (*GroupModel) GetOrgID

func (g *GroupModel) GetOrgID() int64

type GroupPage

type GroupPage struct {
	ID          int64  `db:"id"`
	AccessLevel string `db:"accessLevel"`
}

type GroupResource

type GroupResource struct {
	ID          int64  `db:"id"`
	AccessLevel string `db:"accessLevel"`
}

type GroupResourceFolderDefault

type GroupResourceFolderDefault struct {
	ID          int64  `db:"id"`
	AccessLevel string `db:"accessLevel"`
}

type Logger added in v0.0.6

type Logger struct{}

func (*Logger) Log added in v0.0.6

func (log *Logger) Log(ctx context.Context, level pgx.LogLevel, msg string, data map[string]interface{})

func (*Logger) Pgx2ZapLogLevel added in v0.0.6

func (log *Logger) Pgx2ZapLogLevel(level pgx.LogLevel) zapcore.Level

func (*Logger) Zap2PgxLogLevel added in v0.0.6

func (log *Logger) Zap2PgxLogLevel(level zapcore.Level) pgx.LogLevel

type OrgModel

type OrgModel struct {
	ID   int64  `db:"id"`
	Name string `db:"name"`
}

type PageModel

type PageModel struct {
	ID             int64   `db:"id"`
	Name           string  `db:"name"`
	OrganizationID *int64  `db:"organizationId"`
	FolderID       int64   `db:"folderId"`
	PhotoUrl       *string `db:"photoUrl"`
	Description    *string `db:"description"`
}

func (*PageModel) GetDescription

func (g *PageModel) GetDescription() string

func (*PageModel) GetOrgID

func (g *PageModel) GetOrgID() int64

func (*PageModel) GetPhotoUrl

func (g *PageModel) GetPhotoUrl() string

type Pager

type Pager struct {
	Token string
	Size  int
}

func (*Pager) Parse

func (p *Pager) Parse() (int, int, error)

Parse returns the offset and page size.

type ResourceModel

type ResourceModel struct {
	ID               int64   `db:"id"`
	OrganizationID   int64   `db:"organizationId"`
	Name             string  `db:"name"`
	Type             string  `db:"type"`
	DisplayName      *string `db:"displayName"`
	EnvironmentID    *string `db:"environmentId"`
	ResourceFolderID *int64  `db:"resourceFolderId"`
}

func (*ResourceModel) GetDisplayName

func (u *ResourceModel) GetDisplayName() string

func (*ResourceModel) GetEnvironmentID

func (u *ResourceModel) GetEnvironmentID() string

func (*ResourceModel) GetResourceFolderID

func (g *ResourceModel) GetResourceFolderID() int64

type UserModel

type UserModel struct {
	ID              int64      `db:"id"`
	Email           string     `db:"email"`
	FirstName       *string    `db:"firstName"`
	LastName        *string    `db:"lastName"`
	ProfilePhotoURL *string    `db:"profilePhotoUrl"`
	UserName        *string    `db:"userName"`
	Enabled         bool       `db:"enabled"`
	LastLoggedIn    *time.Time `db:"lastLoggedIn"`
	OrganizationID  int64      `db:"organizationId"`
}

func (*UserModel) GetFirstName

func (u *UserModel) GetFirstName() string

func (*UserModel) GetLastLoggedIn

func (u *UserModel) GetLastLoggedIn() time.Time

func (*UserModel) GetLastName

func (u *UserModel) GetLastName() string

func (*UserModel) GetProfilePhotoUrl

func (u *UserModel) GetProfilePhotoUrl() string

func (*UserModel) GetUserName

func (u *UserModel) GetUserName() string

Jump to

Keyboard shortcuts

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