user

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service provides minimal CRUD helpers on top of datly for users.

func New

func New(ctx context.Context, dao *datly.Service) (*Service, error)

New registers user components on the provided datly service.

func (*Service) FindByUsername

func (s *Service) FindByUsername(ctx context.Context, username string) (*userread.View, error)

FindByUsername returns a single user view or nil.

func (*Service) UpdateAgentSettingsByUsername

func (s *Service) UpdateAgentSettingsByUsername(ctx context.Context, username string, agentPrefs map[string]map[string]interface{}) error

UpdateAgentSettingsByUsername merges per-agent settings into users.settings JSON for the given username. The payload shape is expected as: { agentId: { tools: [], toolCallExposure: "turn|conversation", autoSummarize: bool, chainsEnabled: bool }, ... }

func (*Service) UpdateHashIPByID

func (s *Service) UpdateHashIPByID(ctx context.Context, id, hash string) error

UpdateHashIPByID sets users.hash_ip in a server-controlled way.

func (*Service) UpdatePreferencesByUsername

func (s *Service) UpdatePreferencesByUsername(ctx context.Context, username string, displayName, timezone, defaultAgentRef, defaultModelRef, defaultEmbedderRef *string) error

UpdatePreferencesByUsername updates default agent/model and basic fields for a user identified by username.

func (*Service) UpsertLocal

func (s *Service) UpsertLocal(ctx context.Context, username, displayName, email string) (string, error)

UpsertLocal ensures a user with provider=local exists/updated. Returns user id.

func (*Service) UpsertWithProvider

func (s *Service) UpsertWithProvider(ctx context.Context, username, displayName, email, provider, subject string) (string, error)

UpsertWithProvider ensures a user exists/updated with a specific provider/subject. Returns user id.

Jump to

Keyboard shortcuts

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