supabase

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService added in v0.2.7

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

AuthService handles authentication with Supabase

func NewAuthService added in v0.2.7

func NewAuthService(url, key string) (*AuthService, error)

NewAuthService creates a new authentication service with URL and API key

func NewAuthServiceWithClient added in v0.2.7

func NewAuthServiceWithClient(client *supabase.Client) *AuthService

NewAuthServiceWithClient creates a new authentication service with an existing client

func (*AuthService) GetAccessToken added in v0.2.7

func (a *AuthService) GetAccessToken() string

GetAccessToken returns the current access token

func (*AuthService) GetUser added in v0.2.7

func (a *AuthService) GetUser() (*types.User, error)

GetUser retrieves the current authenticated user

func (*AuthService) IsSessionValid added in v0.2.7

func (a *AuthService) IsSessionValid() bool

IsSessionValid checks if the current session is valid

func (*AuthService) LoginWithEmail added in v0.2.7

func (a *AuthService) LoginWithEmail(email, password string) (*types.Session, error)

LoginWithEmail authenticates a user with email and password

func (*AuthService) Logout added in v0.2.7

func (a *AuthService) Logout() error

Logout signs out the current user

func (*AuthService) RefreshSession added in v0.2.7

func (a *AuthService) RefreshSession() (*types.Session, error)

RefreshSession refreshes the current user's session

func (*AuthService) RegisterWithEmail added in v0.2.7

func (a *AuthService) RegisterWithEmail(email, password, username string) (*types.User, error)

RegisterWithEmail creates a new user account with email, password, and username

type Client

type Client struct {
	*supabase.Client
	// contains filtered or unexported fields
}

Client represents a Supabase client for the StackMatch CLI

func NewClient

func NewClient(url, key string, accessToken ...string) (*Client, error)

NewClient creates a new Supabase client

func (*Client) DeleteEnvironment added in v0.2.7

func (c *Client) DeleteEnvironment(ctx context.Context, name string, userID string) error

DeleteEnvironment deletes an environment from Supabase by name

func (*Client) FindEnvironmentByUserAndName added in v0.2.7

func (c *Client) FindEnvironmentByUserAndName(ctx context.Context, username, envName string) (*types.EnvironmentData, error)

FindEnvironmentByUserAndName finds an environment by username and environment name

func (*Client) GetEnvironment

func (c *Client) GetEnvironment(ctx context.Context, id string) (*types.EnvironmentData, error)

GetEnvironment retrieves an environment from Supabase by ID

func (*Client) GetEnvironmentHistory added in v0.2.7

func (c *Client) GetEnvironmentHistory(ctx context.Context, envID string, limit int) ([]types.EnvironmentHistory, error)

GetEnvironmentHistory retrieves the version history of an environment

func (*Client) ListEnvironments

func (c *Client) ListEnvironments(ctx context.Context, userID string) ([]types.Environment, error)

ListEnvironments retrieves a list of all environments for a given user

func (*Client) SaveEnvironment

func (c *Client) SaveEnvironment(ctx context.Context, env *types.EnvironmentData, name string, isPublic bool) (string, error)

SaveEnvironment saves an environment to Supabase with the given name and visibility If name is empty, it will use a default name isPublic determines if the environment is visible to other users

func (*Client) SearchEnvironments added in v0.2.7

func (c *Client) SearchEnvironments(ctx context.Context, query string) ([]types.Environment, error)

SearchEnvironments searches for public environments in Supabase

Jump to

Keyboard shortcuts

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