contextrpc

package
v0.0.0-...-5c39655 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2017 License: MIT Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

context rpc

The server and client folders implement a simple Go rpc service using gorilla/rpc.

Exercise

Start a single consul node:

$ docker run -p 8400:8400 -p 8500:8500 -p 8600:53/udp -h hostname progrium/consul -server -bootstrap -ui-dir /ui

(This may not work for you if you're running older docker for mac. //FIXME with new instructions there.)

Register the service in consul:

Get local IP address with ifconfig Find the public ip.

run the service: SERVER_IP=x.x.x.x ./server

Run the dig command to see it in Consul's DNS:

dig @127.0.0.1 -p 8600 hello.service.consul SRV

Run curl to see the consul API's registry version of the same record:

curl http://127.0.0.1:8500/v1/catalog/services

For more detailed information about the service, curl: curl http://127.0.0.1:8500/v1/agent/services

Modify the client to read the server address from the consul registry, then call the service

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HelloArgs

type HelloArgs struct {
	Who string
}

type HelloReply

type HelloReply struct {
	Message string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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