command

package
v0.0.0-...-7dcde51 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Execute()
}
Example
package main

func main() {
	key := "uid"
	commands := []Command{
		NewSetIntCommand(key, 123456),
		NewPrintValueCommand(key),
	}

	runCommands(commands...)

}

func runCommands(commands ...Command) {
	for _, c := range commands {
		c.Execute()
	}
}
Output:

123456

type PrintValueCommand

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

func NewPrintValueCommand

func NewPrintValueCommand(key string) *PrintValueCommand

func (*PrintValueCommand) Execute

func (p *PrintValueCommand) Execute()

type SetIntCommand

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

func NewSetIntCommand

func NewSetIntCommand(key string, value int) *SetIntCommand

func (*SetIntCommand) Execute

func (p *SetIntCommand) Execute()

Jump to

Keyboard shortcuts

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