Documentation
¶
Index ¶
- Variables
- func NewLocationStore(pool *pgxpool.Pool) store.LocationStore
- type ChatStore
- func (s *ChatStore) AddChatGroupMember(ctx context.Context, groupID, userID string) error
- func (s *ChatStore) AddReaction(ctx context.Context, messageID, userID, reaction string) error
- func (s *ChatStore) BeginTx(ctx context.Context) (store.Transaction, error)
- func (s *ChatStore) CreateChatGroup(ctx context.Context, group types.ChatGroup) (string, error)
- func (s *ChatStore) CreateChatMessage(ctx context.Context, message types.ChatMessage) (string, error)
- func (s *ChatStore) DeleteChatGroup(ctx context.Context, groupID string) error
- func (s *ChatStore) DeleteChatMessage(ctx context.Context, messageID string) error
- func (s *ChatStore) GetChatGroup(ctx context.Context, groupID string) (*types.ChatGroup, error)
- func (s *ChatStore) GetChatMessageByID(ctx context.Context, messageID string) (*types.ChatMessage, error)
- func (s *ChatStore) GetUserByID(ctx context.Context, userID string) (*types.User, error)
- func (s *ChatStore) ListChatGroupMembers(ctx context.Context, groupID string) ([]types.UserResponse, error)
- func (s *ChatStore) ListChatGroupsByTrip(ctx context.Context, tripID string, limit, offset int) (*types.ChatGroupPaginatedResponse, error)
- func (s *ChatStore) ListChatMessageReactions(ctx context.Context, messageID string) ([]types.ChatMessageReaction, error)
- func (s *ChatStore) ListChatMessages(ctx context.Context, groupID string, params types.PaginationParams) ([]types.ChatMessage, int, error)
- func (s *ChatStore) RemoveChatGroupMember(ctx context.Context, groupID, userID string) error
- func (s *ChatStore) RemoveReaction(ctx context.Context, messageID, userID, reaction string) error
- func (s *ChatStore) UpdateChatGroup(ctx context.Context, groupID string, update types.ChatGroupUpdateRequest) error
- func (s *ChatStore) UpdateChatMessage(ctx context.Context, messageID string, content string) error
- func (s *ChatStore) UpdateLastReadMessage(ctx context.Context, groupID, userID, messageID string) error
- type LocationStore
- func (s *LocationStore) BeginTx(ctx context.Context) (store.Transaction, error)
- func (s *LocationStore) CreateLocation(ctx context.Context, location *types.Location) (string, error)
- func (s *LocationStore) DeleteLocation(ctx context.Context, id string) error
- func (s *LocationStore) GetLocation(ctx context.Context, id string) (*types.Location, error)
- func (s *LocationStore) ListTripMemberLocations(ctx context.Context, tripID string) ([]*types.MemberLocation, error)
- func (s *LocationStore) UpdateLocation(ctx context.Context, id string, update *types.LocationUpdate) (*types.Location, error)
- type TodoStore
- func (s *TodoStore) BeginTx(ctx context.Context) (store.Transaction, error)
- func (s *TodoStore) CreateTodo(ctx context.Context, todo *types.Todo) (string, error)
- func (s *TodoStore) DeleteTodo(ctx context.Context, id string) error
- func (s *TodoStore) GetTodo(ctx context.Context, id string) (*types.Todo, error)
- func (s *TodoStore) ListTodos(ctx context.Context, tripID string) ([]*types.Todo, error)
- func (s *TodoStore) UpdateTodo(ctx context.Context, id string, update *types.TodoUpdate) (*types.Todo, error)
- type Transaction
- type UserStore
- func (s *UserStore) BeginTx(ctx context.Context) (types.DatabaseTransaction, error)
- func (s *UserStore) Commit() error
- func (s *UserStore) ConvertToUserResponse(user *types.User) (types.UserResponse, error)
- func (s *UserStore) CreateUser(ctx context.Context, user *types.User) (string, error)
- func (s *UserStore) GetPool() *pgxpool.Pool
- func (s *UserStore) GetSupabaseUser(ctx context.Context, userID string) (*types.SupabaseUser, error)
- func (s *UserStore) GetUserByEmail(ctx context.Context, email string) (*types.User, error)
- func (s *UserStore) GetUserByID(ctx context.Context, userID string) (*types.User, error)
- func (s *UserStore) GetUserBySupabaseID(ctx context.Context, supabaseID string) (*types.User, error)
- func (s *UserStore) GetUserProfile(ctx context.Context, userID string) (*types.UserProfile, error)
- func (s *UserStore) GetUserProfiles(ctx context.Context, userIDs []string) (map[string]*types.UserProfile, error)
- func (s *UserStore) ListUsers(ctx context.Context, offset, limit int) ([]*types.User, int, error)
- func (s *UserStore) Rollback() error
- func (s *UserStore) SetOnlineStatus(ctx context.Context, userID string, isOnline bool) error
- func (s *UserStore) SyncUserFromSupabase(ctx context.Context, supabaseID string) (*types.User, error)
- func (s *UserStore) UpdateLastSeen(ctx context.Context, userID string) error
- func (s *UserStore) UpdateUser(ctx context.Context, userID string, updates map[string]interface{}) (*types.User, error)
- func (s *UserStore) UpdateUserPreferences(ctx context.Context, userID string, preferences map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotFound = errors.New("record not found")
)
Functions ¶
func NewLocationStore ¶
func NewLocationStore(pool *pgxpool.Pool) store.LocationStore
Types ¶
type ChatStore ¶
type ChatStore struct {
// contains filtered or unexported fields
}
ChatStore implements the store.ChatStore interface using PostgreSQL
func NewChatStore ¶
NewChatStore creates a new ChatStore instance
func (*ChatStore) AddChatGroupMember ¶
func (*ChatStore) AddReaction ¶
func (*ChatStore) CreateChatGroup ¶
func (*ChatStore) CreateChatMessage ¶
func (*ChatStore) DeleteChatGroup ¶
func (*ChatStore) DeleteChatMessage ¶
func (*ChatStore) GetChatGroup ¶
func (*ChatStore) GetChatMessageByID ¶
func (*ChatStore) GetUserByID ¶
GetUserByID retrieves a user by ID This method is added to support tests and interfaces, but user operations should be performed through UserStore
func (*ChatStore) ListChatGroupMembers ¶
func (*ChatStore) ListChatGroupsByTrip ¶
func (*ChatStore) ListChatMessageReactions ¶
func (*ChatStore) ListChatMessages ¶
func (s *ChatStore) ListChatMessages(ctx context.Context, groupID string, params types.PaginationParams) ([]types.ChatMessage, int, error)
func (*ChatStore) RemoveChatGroupMember ¶
func (*ChatStore) RemoveReaction ¶
func (*ChatStore) UpdateChatGroup ¶
func (*ChatStore) UpdateChatMessage ¶
type LocationStore ¶
type LocationStore struct {
// contains filtered or unexported fields
}
func (*LocationStore) BeginTx ¶
func (s *LocationStore) BeginTx(ctx context.Context) (store.Transaction, error)
func (*LocationStore) CreateLocation ¶
func (*LocationStore) DeleteLocation ¶
func (s *LocationStore) DeleteLocation(ctx context.Context, id string) error
func (*LocationStore) GetLocation ¶
func (*LocationStore) ListTripMemberLocations ¶
func (s *LocationStore) ListTripMemberLocations(ctx context.Context, tripID string) ([]*types.MemberLocation, error)
func (*LocationStore) UpdateLocation ¶
func (s *LocationStore) UpdateLocation(ctx context.Context, id string, update *types.LocationUpdate) (*types.Location, error)
type TodoStore ¶
type TodoStore struct {
// contains filtered or unexported fields
}
TodoStore implements the store.TodoStore interface using PostgreSQL
func NewTodoStore ¶
NewTodoStore creates a new TodoStore instance
func (*TodoStore) CreateTodo ¶
CreateTodo creates a new todo item in the database
func (*TodoStore) DeleteTodo ¶
DeleteTodo removes a todo item from the database (soft delete)
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction wraps a pgx.Tx to implement store.Transaction
func (*Transaction) Commit ¶
func (t *Transaction) Commit() error
func (*Transaction) Rollback ¶
func (t *Transaction) Rollback() error
type UserStore ¶
type UserStore struct {
// contains filtered or unexported fields
}
UserStore implements the store.UserStore interface for PostgreSQL.
func NewUserStore ¶
NewUserStore creates a new instance of UserStore
func (*UserStore) ConvertToUserResponse ¶
ConvertToUserResponse converts a User model to UserResponse for API responses
func (*UserStore) CreateUser ¶
CreateUser creates a new user
func (*UserStore) GetSupabaseUser ¶
func (s *UserStore) GetSupabaseUser(ctx context.Context, userID string) (*types.SupabaseUser, error)
GetSupabaseUser fetches a user directly from Supabase
func (*UserStore) GetUserByEmail ¶
GetUserByEmail retrieves a user by their email address
func (*UserStore) GetUserByID ¶
GetUserByID retrieves a user by their ID
func (*UserStore) GetUserBySupabaseID ¶
func (s *UserStore) GetUserBySupabaseID(ctx context.Context, supabaseID string) (*types.User, error)
GetUserBySupabaseID retrieves a user by their Supabase ID
func (*UserStore) GetUserProfile ¶
GetUserProfile retrieves a user profile with minimal information for display
func (*UserStore) GetUserProfiles ¶
func (s *UserStore) GetUserProfiles(ctx context.Context, userIDs []string) (map[string]*types.UserProfile, error)
GetUserProfiles retrieves multiple user profiles by their IDs
func (*UserStore) SetOnlineStatus ¶
SetOnlineStatus sets a user's online status
func (*UserStore) SyncUserFromSupabase ¶
func (s *UserStore) SyncUserFromSupabase(ctx context.Context, supabaseID string) (*types.User, error)
SyncUserFromSupabase fetches user data from Supabase and syncs it with the local database
func (*UserStore) UpdateLastSeen ¶
UpdateLastSeen updates a user's last seen timestamp