comms

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package comms implements high-level command functions.

Index

Constants

This section is empty.

Variables

View Source
var Commands = map[string]Command{
	"get": GetCommand,
	"lst": LstCommand,
	"set": SetCommand,
}

Commands is a map of all existing commands.

Functions

func GetCommand

func GetCommand(db *sqlx.DB, args []string) ([]string, error)

GetCommand returns the value of each existing key.

func LstCommand

func LstCommand(db *sqlx.DB, args []string) ([]string, error)

LstCommand returns the name of each existing key.

func Run

func Run(db *sqlx.DB, name string, args []string) ([]string, error)

Run runs a Command with arguments against a database.

func SetCommand

func SetCommand(db *sqlx.DB, args []string) ([]string, error)

SetCommand sets the value of a new or existing name.

Types

type Command

type Command func(*sqlx.DB, []string) ([]string, error)

Command is a user-executable command function.

Jump to

Keyboard shortcuts

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