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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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