Documentation
¶
Overview ¶
Package names provides name resolution for projects, people, and todolists. It implements fuzzy matching with the following priority: 1. Numeric ID passthrough 2. Exact match (case-sensitive) 3. Case-insensitive match 4. Partial match (contains)
Index ¶
- type Person
- type Project
- type Resolver
- func (r *Resolver) ClearCache()
- func (r *Resolver) GetPeople(ctx context.Context) ([]Person, error)
- func (r *Resolver) GetProjects(ctx context.Context) ([]Project, error)
- func (r *Resolver) GetTodolists(ctx context.Context, projectID string) ([]Todolist, error)
- func (r *Resolver) ResolvePerson(ctx context.Context, input string) (string, string, error)
- func (r *Resolver) ResolvePersonByID(ctx context.Context, id int64) (*Person, error)
- func (r *Resolver) ResolvePersonByName(ctx context.Context, input string) (*Person, error)
- func (r *Resolver) ResolveProject(ctx context.Context, input string) (string, string, error)
- func (r *Resolver) ResolveTodolist(ctx context.Context, input, projectID string) (string, string, error)
- func (r *Resolver) SetAccountID(accountID string)
- type Todolist
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Person ¶
type Person struct {
ID int64 `json:"id"`
AttachableSGID string `json:"attachable_sgid,omitempty"`
Name string `json:"name"`
Email string `json:"email_address"`
PersonableType string `json:"personable_type,omitempty"` // e.g., "User", "Client"
}
Person represents a Basecamp person for name resolution.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves names to IDs for projects, people, and todolists.
func NewResolver ¶
NewResolver creates a new name resolver. The accountID is used to configure the SDK client for account-scoped API calls.
func (*Resolver) GetProjects ¶
GetProjects returns all projects (useful for pickers).
func (*Resolver) GetTodolists ¶
GetTodolists returns all todolists for a project (useful for pickers).
func (*Resolver) ResolvePerson ¶
ResolvePerson resolves a person name, email, or ID to an ID. Special case: "me" resolves to the current user. Returns the ID and the person's name for display.
func (*Resolver) ResolvePersonByID ¶ added in v0.7.0
ResolvePersonByID looks up a person by numeric ID in the pingable set. Returns the Person record including AttachableSGID. Returns not-found if the person is not in the pingable set.
func (*Resolver) ResolvePersonByName ¶ added in v0.7.0
ResolvePersonByName resolves a person name to a full Person record including AttachableSGID. Resolves against the pingable set only — mentions require the target to be pingable.
func (*Resolver) ResolveProject ¶
ResolveProject resolves a project name or ID to an ID. Returns the ID and the project name for display.
func (*Resolver) ResolveTodolist ¶
func (r *Resolver) ResolveTodolist(ctx context.Context, input, projectID string) (string, string, error)
ResolveTodolist resolves a todolist name or ID within a project. Returns the ID and the todolist name for display.
func (*Resolver) SetAccountID ¶
SetAccountID updates the account ID used by the resolver. This clears the cache since cached data is account-specific.