snowflake

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SnowflakeClient

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

SnowflakeClient is the client for interacting with Snowflake REST API

func NewClient

func NewClient(connection map[string]interface{}, poolCfg httpclient.ConnectionPoolConfig,
	hystrixCfg httpclient.HystrixResiliencyConfig) (*SnowflakeClient, error)

NewClient creates a new Snowflake client with the given configuration

func (*SnowflakeClient) AddUserToTeam

func (c *SnowflakeClient) AddUserToTeam(ctx context.Context, teamID string, userIDs []string) error

AddUserToTeam adds users to a team (grants role to users)

func (*SnowflakeClient) CreateTeam

func (c *SnowflakeClient) CreateTeam(ctx context.Context, team *structs.Team) (*structs.Team, error)

CreateTeam creates a new role in Snowflake using REST API

func (*SnowflakeClient) CreateUser

func (c *SnowflakeClient) CreateUser(ctx context.Context, user *structs.User) (*structs.User, error)

CreateUser creates a new user in Snowflake using REST API

func (*SnowflakeClient) DeleteTeamByID

func (c *SnowflakeClient) DeleteTeamByID(ctx context.Context, teamID string) error

DeleteTeamByID deletes a role in Snowflake using REST API

func (*SnowflakeClient) DeleteUser

func (c *SnowflakeClient) DeleteUser(ctx context.Context, userID string) error

DeleteUser deletes a user from Snowflake using REST API

func (*SnowflakeClient) FetchAllTeams

func (c *SnowflakeClient) FetchAllTeams(ctx context.Context) (map[string]structs.Team, error)

FetchAllTeams fetches all roles from Snowflake using REST API with proper pagination

func (*SnowflakeClient) FetchAllUsers

func (c *SnowflakeClient) FetchAllUsers(ctx context.Context) (map[string]*structs.User,
	map[string]*structs.User, error)

FetchAllUsers fetches all users from Snowflake using REST API with proper pagination Snowflake pagination works as follows: 1. First call /api/v2/users - returns first page + Link header with result ID 2. Subsequent calls /api/v2/results/{result_id}?page=N - returns additional pages Returns 2 maps: 1st map keyed by ID, 2nd map keyed by email

func (*SnowflakeClient) FetchTeamDetails

func (c *SnowflakeClient) FetchTeamDetails(ctx context.Context, teamID string) (*structs.Team, error)

FetchTeamDetails returns basic team information without making API calls since the detailed information is not consumed by the reconciliation workflow

func (*SnowflakeClient) FetchTeamMembersByTeamID

func (c *SnowflakeClient) FetchTeamMembersByTeamID(ctx context.Context,
	teamID string) (map[string]*structs.User, error)

FetchTeamMembersByTeamID fetches team members for a given team ID using the correct REST API endpoint

func (*SnowflakeClient) FetchUserDetails

func (c *SnowflakeClient) FetchUserDetails(ctx context.Context, userID string) (*structs.User, error)

FetchUserDetails fetches details for a specific user using REST API

func (*SnowflakeClient) GetConfig

func (c *SnowflakeClient) GetConfig() *SnowflakeConfig

GetConfig returns the client configuration

func (*SnowflakeClient) RemoveUserFromTeam

func (c *SnowflakeClient) RemoveUserFromTeam(ctx context.Context, teamID string, userIDs []string) error

RemoveUserFromTeam removes users from a team (revokes role from users)

type SnowflakeConfig

type SnowflakeConfig struct {
	PAT     string
	BaseURL string
}

SnowflakeConfig holds the configuration for Snowflake client

type SnowflakeGrant

type SnowflakeGrant struct {
	GrantedTo   string `json:"granted_to"`
	GranteeName string `json:"grantee_name"`
}

SnowflakeGrant represents a grant object from Snowflake grants API response

type SnowflakeRole

type SnowflakeRole struct {
	Name string `json:"name"`
}

SnowflakeRole represents a role object from Snowflake roles API response

type SnowflakeUser

type SnowflakeUser struct {
	Name        string `json:"name"`
	Email       string `json:"email,omitempty"`
	DisplayName string `json:"displayName,omitempty"`
}

SnowflakeUser represents a user object from Snowflake API response

Jump to

Keyboard shortcuts

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