store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPool

func NewPool(ctx context.Context) (*pgxpool.Pool, error)

Types

type HiveshareStore

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

func NewHiveshareStore

func NewHiveshareStore(db *pgxpool.Pool) *HiveshareStore

func (*HiveshareStore) AcceptInvitation

func (s *HiveshareStore) AcceptInvitation(ctx context.Context, token string) error

func (*HiveshareStore) AddMember

func (s *HiveshareStore) AddMember(ctx context.Context, hiveshareID, userID, invitedBy uuid.UUID, role string) error

func (*HiveshareStore) Create

func (s *HiveshareStore) Create(ctx context.Context, name, description string, ownerID uuid.UUID) (*models.Hiveshare, error)

func (*HiveshareStore) CreateInvitation

func (s *HiveshareStore) CreateInvitation(ctx context.Context, inv *models.Invitation) error

CreateInvitation creates a pending invitation.

func (*HiveshareStore) Delete

func (s *HiveshareStore) Delete(ctx context.Context, id uuid.UUID) error

func (*HiveshareStore) Get

func (s *HiveshareStore) Get(ctx context.Context, id, userID uuid.UUID) (*models.Hiveshare, error)

func (*HiveshareStore) GetInvitation

func (s *HiveshareStore) GetInvitation(ctx context.Context, token string) (*models.Invitation, error)

func (*HiveshareStore) IsMember

func (s *HiveshareStore) IsMember(ctx context.Context, hiveshareID, userID uuid.UUID) (string, error)

func (*HiveshareStore) ListForUser

func (s *HiveshareStore) ListForUser(ctx context.Context, userID uuid.UUID) ([]*models.Hiveshare, error)

func (*HiveshareStore) ListMembers

func (s *HiveshareStore) ListMembers(ctx context.Context, hiveshareID uuid.UUID) ([]*models.Member, error)

func (*HiveshareStore) RemoveMember

func (s *HiveshareStore) RemoveMember(ctx context.Context, hiveshareID, userID uuid.UUID) error

func (*HiveshareStore) Update

func (s *HiveshareStore) Update(ctx context.Context, id uuid.UUID, name, description string) (*models.Hiveshare, error)

type ListMemoryFilter

type ListMemoryFilter struct {
	SourceType string
	SourceRef  string
	Tag        string
	Tool       string
	Limit      int
	Offset     int
}

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore(db *pgxpool.Pool) *MemoryStore

func (*MemoryStore) Create

func (s *MemoryStore) Create(ctx context.Context, e *models.MemoryEntry, embedding []float32) (*models.MemoryEntry, error)

func (*MemoryStore) Delete

func (s *MemoryStore) Delete(ctx context.Context, id, hiveshareID uuid.UUID) error

func (*MemoryStore) Get

func (s *MemoryStore) Get(ctx context.Context, id, hiveshareID uuid.UUID) (*models.MemoryEntry, error)

func (*MemoryStore) IncrementReuse

func (s *MemoryStore) IncrementReuse(ctx context.Context, id uuid.UUID) error

func (*MemoryStore) List

func (s *MemoryStore) List(ctx context.Context, hiveshareID uuid.UUID, f ListMemoryFilter) ([]*models.MemoryEntry, error)

func (*MemoryStore) SearchFullText

func (s *MemoryStore) SearchFullText(ctx context.Context, hiveshareID uuid.UUID, query, sourceType string, limit int) ([]*models.MemoryEntry, error)

SearchFullText performs PostgreSQL full-text search.

func (*MemoryStore) SearchVector

func (s *MemoryStore) SearchVector(ctx context.Context, hiveshareID uuid.UUID, embedding []float32, sourceType string, limit int) ([]*models.MemoryEntry, error)

SearchVector performs cosine similarity search.

func (*MemoryStore) Update

func (s *MemoryStore) Update(ctx context.Context, id, hiveshareID uuid.UUID, content, summary string, tags []string) (*models.MemoryEntry, error)

type MetricsStore

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

func NewMetricsStore

func NewMetricsStore(db *pgxpool.Pool) *MetricsStore

func (*MetricsStore) HiveshareMetrics

func (s *MetricsStore) HiveshareMetrics(ctx context.Context, hsID uuid.UUID) (*models.HiveshareMetrics, error)

func (*MetricsStore) RecordEvent

func (s *MetricsStore) RecordEvent(ctx context.Context, ev *models.UsageEvent) error

func (*MetricsStore) UserMetrics

func (s *MetricsStore) UserMetrics(ctx context.Context, userID uuid.UUID) (*models.UserMetrics, error)

type UserStore

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

func NewUserStore

func NewUserStore(db *pgxpool.Pool) *UserStore

func (*UserStore) Create

func (s *UserStore) Create(ctx context.Context, email, name string) (*models.User, error)

func (*UserStore) GetByAPIKey

func (s *UserStore) GetByAPIKey(ctx context.Context, key string) (*models.User, error)

func (*UserStore) GetByEmail

func (s *UserStore) GetByEmail(ctx context.Context, email string) (*models.User, error)

func (*UserStore) GetByID

func (s *UserStore) GetByID(ctx context.Context, id uuid.UUID) (*models.User, error)

Jump to

Keyboard shortcuts

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