Documentation
¶
Overview ¶
Package profile manages css profiles: saving, restoring, listing, deleting, and tracking the active profile.
Index ¶
- func ValidateName(name string) error
- type Profile
- type State
- type Store
- func (s *Store) Activate(name string) error
- func (s *Store) Active() (string, error)
- func (s *Store) Delete(name string) error
- func (s *Store) Exists(name string) bool
- func (s *Store) List() ([]Profile, error)
- func (s *Store) Root() string
- func (s *Store) Save(name string) (Profile, error)
- func (s *Store) SetActive(name string) error
- func (s *Store) State() (State, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateName ¶
ValidateName checks that name is safe to use as a profile identifier.
Types ¶
type Profile ¶
type Profile struct {
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Profile is a saved subscription snapshot.
type State ¶
type State struct {
Active string `json:"active,omitempty"`
}
State is the persisted global css state.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the profile repository.
func (*Store) Activate ¶
Activate switches to the named profile.
Sequence:
- If another profile is currently active, write its current state back to disk first (preserves session, context, todos, etc.).
- Remove all Claude files/dirs from the home directory.
- Restore the target profile payload into the home directory.
- Update state.json.
func (*Store) Delete ¶
Delete permanently removes a saved profile. If the deleted profile was active, the active flag is cleared.
func (*Store) Save ¶
Save snapshots the current Claude state under the given profile name. Overwrites any existing snapshot with the same name.
Click to show internal directories.
Click to hide internal directories.