model

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeEmail

func NormalizeEmail(email string) string

func NormalizeName

func NormalizeName(name string) string

func NormalizePhone

func NormalizePhone(phone string) string

func PathSlug

func PathSlug(path string) string

func Slug

func Slug(name string) string

Types

type AvatarRef

type AvatarRef struct {
	Path      string    `json:"path,omitempty" yaml:"path,omitempty"`
	Source    string    `json:"source,omitempty" yaml:"source,omitempty"`
	MIME      string    `json:"mime,omitempty" yaml:"mime,omitempty"`
	SHA256    string    `json:"sha256,omitempty" yaml:"sha256,omitempty"`
	Width     int       `json:"width,omitempty" yaml:"width,omitempty"`
	Height    int       `json:"height,omitempty" yaml:"height,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitzero" yaml:"updated_at,omitempty"`
}

type ContactValue

type ContactValue struct {
	Value   string `json:"value" yaml:"value"`
	Label   string `json:"label,omitempty" yaml:"label,omitempty"`
	Source  string `json:"source,omitempty" yaml:"source,omitempty"`
	Primary bool   `json:"primary,omitempty" yaml:"primary,omitempty"`
}

type ExternalRef

type ExternalRef struct {
	ID         string    `json:"id,omitempty" yaml:"id,omitempty"`
	Resource   string    `json:"resource,omitempty" yaml:"resource,omitempty"`
	ETag       string    `json:"etag,omitempty" yaml:"etag,omitempty"`
	LastSeenAt time.Time `json:"last_seen_at,omitzero" yaml:"last_seen_at,omitempty"`
}

type ImportChange

type ImportChange struct {
	Action   string        `json:"action"`
	PersonID string        `json:"person_id,omitempty"`
	Name     string        `json:"name"`
	Source   SourceContact `json:"source"`
	Path     string        `json:"path,omitempty"`
}

type Note

type Note struct {
	ID         string    `json:"id" yaml:"id"`
	PersonID   string    `json:"person_id" yaml:"person_id"`
	OccurredAt time.Time `json:"occurred_at" yaml:"occurred_at"`
	CapturedAt time.Time `json:"captured_at" yaml:"captured_at"`
	Kind       string    `json:"kind" yaml:"kind"`
	Source     string    `json:"source" yaml:"source"`
	Account    string    `json:"account,omitempty" yaml:"account,omitempty"`
	ExternalID string    `json:"external_id,omitempty" yaml:"external_id,omitempty"`
	Direction  string    `json:"direction,omitempty" yaml:"direction,omitempty"`
	Confidence string    `json:"confidence,omitempty" yaml:"confidence,omitempty"`
	Topics     []string  `json:"topics,omitempty" yaml:"topics,omitempty"`
	FollowUpAt time.Time `json:"follow_up_at,omitzero" yaml:"follow_up_at,omitempty"`
	Privacy    string    `json:"privacy,omitempty" yaml:"privacy,omitempty"`
	Path       string    `json:"path,omitempty" yaml:"-"`
	Body       string    `json:"body,omitempty" yaml:"-"`
}

type Person

type Person struct {
	ID        string                    `json:"id" yaml:"id"`
	Name      string                    `json:"name" yaml:"name"`
	SortName  string                    `json:"sort_name,omitempty" yaml:"sort_name,omitempty"`
	Tags      []string                  `json:"tags,omitempty" yaml:"tags,omitempty"`
	Emails    []ContactValue            `json:"emails,omitempty" yaml:"emails,omitempty"`
	Phones    []ContactValue            `json:"phones,omitempty" yaml:"phones,omitempty"`
	Avatar    AvatarRef                 `json:"avatar,omitzero" yaml:"avatar,omitempty"`
	Accounts  map[string][]string       `json:"accounts,omitempty" yaml:"accounts,omitempty"`
	Apple     ExternalRef               `json:"apple,omitzero" yaml:"apple,omitempty"`
	Google    ExternalRef               `json:"google,omitzero" yaml:"google,omitempty"`
	CreatedAt time.Time                 `json:"created_at" yaml:"created_at"`
	UpdatedAt time.Time                 `json:"updated_at" yaml:"updated_at"`
	Path      string                    `json:"path,omitempty" yaml:"-"`
	Body      string                    `json:"body,omitempty" yaml:"-"`
	Extra     map[string]map[string]any `json:"extra,omitempty" yaml:"-"`
}

type SearchHit

type SearchHit struct {
	Kind      string    `json:"kind"`
	ID        string    `json:"id"`
	PersonID  string    `json:"person_id,omitempty"`
	Name      string    `json:"name,omitempty"`
	Path      string    `json:"path"`
	Score     int       `json:"score"`
	Snippet   string    `json:"snippet,omitempty"`
	Timestamp time.Time `json:"timestamp,omitzero"`
}

type SourceAvatar

type SourceAvatar struct {
	Data   []byte `json:"-"`
	MIME   string `json:"mime,omitempty"`
	SHA256 string `json:"sha256,omitempty"`
	URL    string `json:"url,omitempty"`
}

type SourceContact

type SourceContact struct {
	Source     string              `json:"source"`
	ExternalID string              `json:"external_id,omitempty"`
	Name       string              `json:"name"`
	Tags       []string            `json:"tags,omitempty"`
	Emails     []ContactValue      `json:"emails,omitempty"`
	Phones     []ContactValue      `json:"phones,omitempty"`
	Avatar     *SourceAvatar       `json:"avatar,omitempty"`
	Accounts   map[string][]string `json:"accounts,omitempty"`
	ETag       string              `json:"etag,omitempty"`
}

Jump to

Keyboard shortcuts

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