request.go 411 Bytes
Newer Older
Matt Bell's avatar
Matt Bell committed
1 2 3 4 5
package commands

// Request represents a call to a command from a consumer
type Request struct {
  options map[string]interface{}
6
  arguments []string
Matt Bell's avatar
Matt Bell committed
7 8
}

9 10
func (r *Request) Option(name string) interface{} {
  return r.options[name]
Matt Bell's avatar
Matt Bell committed
11 12
}

13 14 15
func (r *Request) Arguments() []string {
  return r.arguments
}
Matt Bell's avatar
Matt Bell committed
16 17 18 19

func NewRequest() *Request {
  return &Request{
    make(map[string]interface{}),
20
    make([]string, 0),
Matt Bell's avatar
Matt Bell committed
21 22
  }
}