alias

package
v0.2.18 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsReserved

func IsReserved(name string) bool

IsReserved returns true if the name is a reserved keyword.

Types

type Config

type Config struct {
	Aliases map[string]string `json:"aliases,omitempty"`
}

Config represents the config file structure with aliases.

type Store

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

Store manages chat ID aliases persisted to a config file.

func NewStore

func NewStore(path string) (*Store, error)

NewStore creates or loads an alias store from the given config path.

func (*Store) Get

func (s *Store) Get(name string) (string, bool)

Get returns the chat ID for an alias, or false if not found.

func (*Store) List

func (s *Store) List() map[string]string

List returns all aliases.

func (*Store) Remove

func (s *Store) Remove(name string) error

Remove deletes an alias.

func (*Store) Set

func (s *Store) Set(name, chatID string) error

Set creates or updates an alias.

Jump to

Keyboard shortcuts

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