Documentation
¶
Index ¶
- Variables
- func ConfigureDB(db *sql.DB) error
- func OpenDB(dbPath string) (*sql.DB, error)
- type AuthStore
- func (s *AuthStore) AssignAgent(ctx context.Context, userID int64, agentID string) error
- func (s *AuthStore) CountUsers(ctx context.Context) (int64, error)
- func (s *AuthStore) CreateIdentity(ctx context.Context, i auth.Identity) (auth.Identity, error)
- func (s *AuthStore) CreatePolicy(ctx context.Context, p auth.Policy) (auth.Policy, error)
- func (s *AuthStore) CreateSession(ctx context.Context, sess auth.Session) (auth.Session, error)
- func (s *AuthStore) CreateUser(ctx context.Context, username, passwordHash string) (auth.AuthUser, error)
- func (s *AuthStore) DeleteExpiredSessions(ctx context.Context) error
- func (s *AuthStore) DeleteIdentity(ctx context.Context, id int64) error
- func (s *AuthStore) DeletePolicy(ctx context.Context, id string) error
- func (s *AuthStore) DeleteSession(ctx context.Context, id string) error
- func (s *AuthStore) DeleteUser(ctx context.Context, id int64) error
- func (s *AuthStore) DeleteUserSessions(ctx context.Context, userID int64) error
- func (s *AuthStore) GetIdentity(ctx context.Context, id int64) (auth.Identity, error)
- func (s *AuthStore) GetIdentityByPlatform(ctx context.Context, platform, externalID string) (auth.Identity, error)
- func (s *AuthStore) GetPolicy(ctx context.Context, id string) (auth.Policy, error)
- func (s *AuthStore) GetSession(ctx context.Context, id string) (auth.Session, error)
- func (s *AuthStore) GetUser(ctx context.Context, id int64) (auth.AuthUser, error)
- func (s *AuthStore) GetUserByUsername(ctx context.Context, username string) (auth.AuthUser, error)
- func (s *AuthStore) ListAgentUserIDs(ctx context.Context, agentID string) ([]int64, error)
- func (s *AuthStore) ListEnabledPolicies(ctx context.Context) ([]auth.Policy, error)
- func (s *AuthStore) ListIdentitiesByUser(ctx context.Context, userID int64) ([]auth.Identity, error)
- func (s *AuthStore) ListPolicies(ctx context.Context) ([]auth.Policy, error)
- func (s *AuthStore) ListUserAgentIDs(ctx context.Context, userID int64) ([]string, error)
- func (s *AuthStore) ListUsers(ctx context.Context) ([]auth.AuthUser, error)
- func (s *AuthStore) RemoveAgent(ctx context.Context, userID int64, agentID string) error
- func (s *AuthStore) UpdatePolicy(ctx context.Context, p auth.Policy) error
- func (s *AuthStore) UpdateSessionExpiry(ctx context.Context, id string, expiresAt time.Time) error
- func (s *AuthStore) UpdateUser(ctx context.Context, u auth.AuthUser) error
- func (s *AuthStore) UpdateUserDefaultAgent(ctx context.Context, userID int64, agentID string) error
- func (s *AuthStore) UpdateUserNotifyIdentity(ctx context.Context, userID int64, identityID *int64) error
- func (s *AuthStore) UpdateUserRole(ctx context.Context, userID int64, role string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var MigrationsFS embed.FS
MigrationsFS holds Atlas migration files. Embed the entire directory so it works even when no migrations exist yet.
Functions ¶
func ConfigureDB ¶ added in v0.8.0
ConfigureDB enables WAL mode and foreign keys on an existing *sql.DB. This is useful when multiple packages need to share the same connection.
Types ¶
type AuthStore ¶ added in v0.9.0
type AuthStore struct {
// contains filtered or unexported fields
}
AuthStore implements auth.AuthStore using sqlc queries backed by SQLite.
func NewAuthStore ¶ added in v0.9.0
NewAuthStore creates a new AuthStore wrapping the given database connection.
func (*AuthStore) AssignAgent ¶ added in v0.9.0
func (*AuthStore) CountUsers ¶ added in v0.9.0
func (*AuthStore) CreateIdentity ¶ added in v0.9.0
func (*AuthStore) CreatePolicy ¶ added in v0.9.0
func (*AuthStore) CreateSession ¶ added in v0.9.0
func (*AuthStore) CreateUser ¶ added in v0.9.0
func (*AuthStore) DeleteExpiredSessions ¶ added in v0.9.0
func (*AuthStore) DeleteIdentity ¶ added in v0.9.0
func (*AuthStore) DeletePolicy ¶ added in v0.9.0
func (*AuthStore) DeleteSession ¶ added in v0.9.0
func (*AuthStore) DeleteUser ¶ added in v0.9.0
func (*AuthStore) DeleteUserSessions ¶ added in v0.9.0
func (*AuthStore) GetIdentity ¶ added in v0.9.0
func (*AuthStore) GetIdentityByPlatform ¶ added in v0.9.0
func (*AuthStore) GetSession ¶ added in v0.9.0
func (*AuthStore) GetUserByUsername ¶ added in v0.9.0
func (*AuthStore) ListAgentUserIDs ¶ added in v0.9.0
func (*AuthStore) ListEnabledPolicies ¶ added in v0.9.0
func (*AuthStore) ListIdentitiesByUser ¶ added in v0.9.0
func (*AuthStore) ListPolicies ¶ added in v0.9.0
func (*AuthStore) ListUserAgentIDs ¶ added in v0.9.0
func (*AuthStore) RemoveAgent ¶ added in v0.9.0
func (*AuthStore) UpdatePolicy ¶ added in v0.9.0
func (*AuthStore) UpdateSessionExpiry ¶ added in v0.9.0
func (*AuthStore) UpdateUser ¶ added in v0.9.0
func (*AuthStore) UpdateUserDefaultAgent ¶ added in v0.9.0
func (*AuthStore) UpdateUserNotifyIdentity ¶ added in v0.9.0
Click to show internal directories.
Click to hide internal directories.