Documentation ¶
Index ¶
- Constants
- type Config
- type NameParts
- type Session
- func (cs *Session) Behavior() string
- func (cs *Session) ID() string
- func (cs *Session) Key() string
- func (cs *Session) LastRenewed() time.Time
- func (cs *Session) Name() string
- func (cs *Session) RenewInterval() time.Duration
- func (cs *Session) Run()
- func (cs *Session) Running() bool
- func (cs *Session) State() State
- func (cs *Session) Stop() error
- func (cs *Session) TTL() time.Duration
- type State
- type Update
- type UpdateFunc
Constants ¶
View Source
const (
DefaultTTL = "30s"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Key [suggested] // // Implementation-specific Key to be placed in session key. Key string // TTL [optional] // // Session TTL, defaults to value of DefaultTTL TTL string // Behavior [optional] // // Session timeout behavior, defaults to "release" Behavior string // Log [optional] // // Logger for this session. One will be created if value is empty Log log.DebugLogger // Client [optional] // // Consul API client, default will be created if not provided Client *api.Client // UpdateFunc [optional] // // Callback to be executed after session state change UpdateFunc UpdateFunc // AutoRun [optional] // // Whether the session should start immediately after successful construction AutoRun bool }
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) LastRenewed ¶
func (*Session) RenewInterval ¶
type UpdateFunc ¶
type UpdateFunc func(Update)
Click to show internal directories.
Click to hide internal directories.