msg

package
v0.0.0-...-97873b2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2014 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback struct {
	UUID string

	// Name of the service
	Name        string
	Version     string
	Environment string
	Region      string
	Host        string

	Reply string
	Port  uint16
}

func (Callback) Call

func (c Callback) Call(s Service)

Call calls the callback and performs the HTTP request.

type Service

type Service struct {
	UUID        string
	Name        string
	Version     string
	Environment string
	Region      string
	Host        string
	Port        uint16
	TTL         uint32 // Seconds
	Expires     time.Time
	Callback    map[string]Callback `json:"-"` // Callbacks are found by UUID
	NoExpire    bool                // don't expire the service based on the ttl
}

func (*Service) RemainingTTL

func (s *Service) RemainingTTL() uint32

RemainingTTL returns the amount of time remaining before expiration.

func (*Service) UpdateTTL

func (s *Service) UpdateTTL()

UpdateTTL updates the TTL property to the RemainingTTL.

Jump to

Keyboard shortcuts

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