"Fossies" - the Fresh Open Source Software Archive

Member "gdrive-2.1.1/cli/context.go" (28 May 2021, 566 Bytes) of package /linux/misc/old/gdrive-2.1.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Go source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 package cli
    2 
    3 type Context struct {
    4     args     Arguments
    5     handlers []*Handler
    6 }
    7 
    8 func (self Context) Args() Arguments {
    9     return self.args
   10 }
   11 
   12 func (self Context) Handlers() []*Handler {
   13     return self.handlers
   14 }
   15 
   16 type Arguments map[string]interface{}
   17 
   18 func (self Arguments) String(key string) string {
   19     return self[key].(string)
   20 }
   21 
   22 func (self Arguments) Int64(key string) int64 {
   23     return self[key].(int64)
   24 }
   25 
   26 func (self Arguments) Bool(key string) bool {
   27     return self[key].(bool)
   28 }
   29 
   30 func (self Arguments) StringSlice(key string) []string {
   31     return self[key].([]string)
   32 }