-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmd.go
46 lines (34 loc) · 903 Bytes
/
cmd.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package server
import (
"context"
"net/url"
// Packages
"github.com/mutablelogic/go-client"
)
///////////////////////////////////////////////////////////////////////////////
// INTERFACES
// Cmd represents the command line interface context
type Cmd interface {
// Return the context
Context() context.Context
// Return the debug mode
GetDebug() DebugLevel
// Return the endpoint
GetEndpoint(paths ...string) *url.URL
// Return the HTTP client options
GetClientOpts() []client.ClientOpt
}
///////////////////////////////////////////////////////////////////////////////
// TYPES
type DebugLevel uint
type CmdOffsetLimit struct {
Offset uint64 `name:"offset" help:"List item offset"`
Limit *uint64 `name:"limit" help:"List item limit"`
}
///////////////////////////////////////////////////////////////////////////////
// GLOBALS
const (
None DebugLevel = iota
Debug
Trace
)