goworld: github.com/xiaonanln/goworld/engine/common Index | Files

package common

import "github.com/xiaonanln/goworld/engine/common"


Package Files

collections.go types.go



CLIENTID_LENGTH is the length of Client IDs


ENTITYID_LENGTH is the length of Entity IDs

type ClientID Uses

type ClientID string

ClientID type

func GenClientID Uses

func GenClientID() ClientID

GenClientID generates a new Client ID

func (ClientID) IsNil Uses

func (id ClientID) IsNil() bool

IsNil returns if ClientID is nil

type EntityID Uses

type EntityID string

EntityID type

func GenEntityID Uses

func GenEntityID() EntityID

GenEntityID generates a new EntityID

func MustEntityID Uses

func MustEntityID(id string) EntityID

MustEntityID assures a string to be EntityID

func (EntityID) IsNil Uses

func (id EntityID) IsNil() bool

IsNil returns if EntityID is nil

type StringList Uses

type StringList []string

StringList is a list of string (slice)

func (*StringList) Append Uses

func (sl *StringList) Append(elem string)

Append add the string to the end of StringList

func (*StringList) Find Uses

func (sl *StringList) Find(s string) int

Find get the index of string in StringList, returns -1 if not found

func (*StringList) Remove Uses

func (sl *StringList) Remove(elem string)

Remove removes the string from StringList

type StringSet Uses

type StringSet map[string]struct{}

StringSet is a set of strings

func (StringSet) Add Uses

func (ss StringSet) Add(elem string)

Add adds the string to StringSet

func (StringSet) Contains Uses

func (ss StringSet) Contains(elem string) bool

Contains checks if Stringset contains the string

func (StringSet) Remove Uses

func (ss StringSet) Remove(elem string)

Remove removes the string from StringList

func (StringSet) ToList Uses

func (ss StringSet) ToList() []string

ToList convert StringSet to string slice

Package common imports 2 packages (graph) and is imported by 13 packages. Updated 2017-08-26. Refresh now. Tools for package owners.