server

package
v0.0.0-...-0172ae5 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2017 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Name string

	MAC data.MACAddr
	IP  data.IPAddr
	// contains filtered or unexported fields
}

type Group

type Group struct {
	sync.Mutex
	Name     string
	Password string

	Net       data.IPAddr
	Mask      data.IPAddr
	GatewayIP data.IPAddr

	Clients map[data.MACAddr]*Client
	// contains filtered or unexported fields
}

type Instance

type Instance struct {
	sync.Mutex

	ActiveGroups map[string]*Group
}

func New

func New() *Instance

func (*Instance) CreateGroup

func (i *Instance) CreateGroup(req *data.CreateGroupRequest, c *Client) *data.CreateGroupResponse

func (*Instance) JoinGroup

func (i *Instance) JoinGroup(req *data.JoinGroupRequest, c *Client) *data.JoinGroupResponse

func (*Instance) LeaveGroup

func (i *Instance) LeaveGroup(c *Client) *data.LeaveGroupResponse

func (*Instance) ListGroups

func (i *Instance) ListGroups(req *data.ListGroupsRequest) *data.ListGroupsResponse

func (*Instance) ListenAndServe

func (i *Instance) ListenAndServe(n, addr string) error

Jump to

Keyboard shortcuts

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