Documentation
¶
Index ¶
- type AuthService
- func (a *AuthService) GetAccessToken() string
- func (a *AuthService) GetUser() (*types.User, error)
- func (a *AuthService) IsSessionValid() bool
- func (a *AuthService) LoginWithEmail(email, password string) (*types.Session, error)
- func (a *AuthService) Logout() error
- func (a *AuthService) RefreshSession() (*types.Session, error)
- func (a *AuthService) RegisterWithEmail(email, password, username string) (*types.User, error)
- type Client
- func (c *Client) DeleteEnvironment(ctx context.Context, name string, userID string) error
- func (c *Client) FindEnvironmentByUserAndName(ctx context.Context, username, envName string) (*types.EnvironmentData, error)
- func (c *Client) GetEnvironment(ctx context.Context, id string) (*types.EnvironmentData, error)
- func (c *Client) GetEnvironmentHistory(ctx context.Context, envID string, limit int) ([]types.EnvironmentHistory, error)
- func (c *Client) ListEnvironments(ctx context.Context, userID string) ([]types.Environment, error)
- func (c *Client) SaveEnvironment(ctx context.Context, env *types.EnvironmentData, name string, isPublic bool) (string, error)
- func (c *Client) SearchEnvironments(ctx context.Context, query string) ([]types.Environment, error)
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 ¶
Client represents a Supabase client for the StackMatch CLI
func (*Client) DeleteEnvironment ¶ added in v0.2.7
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 ¶
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 ¶
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
SearchEnvironments searches for public environments in Supabase