Documentation ¶
Index ¶
- Constants
- func LogHealthPeriodically()
- func NewServer(ctx context.Context, listenAddr string, keyStr string) error
- func Request(addr string, key []byte, msgType byte, data []byte) (byte, []byte, error)
- func RequestCheck(addr string, key []byte, cid string) (bool, error)
- func RequestClean(addr string, key []byte, cid string) (string, error)
- func RequestDisconnect(addr string, key []byte) (string, error)
- func RequestGetID(addr string, key []byte) (string, error)
- func RequestLookup(addr string, key []byte, sendFile SendFile) error
- func RequestPublish(addr string, key []byte, content []byte) (string, error)
- func RequestSetID(addr string, key []byte, ids []string) ([]string, error)
- func WriteError(w http.ResponseWriter, header int, msg string)
- type SendFile
Constants ¶
View Source
const ( GetID = 1 SetID = 2 Check = 3 Publish = 4 Lookup = 5 Clean = 6 Disconnect = 7 )
Variables ¶
This section is empty.
Functions ¶
func LogHealthPeriodically ¶
func LogHealthPeriodically()
func RequestCheck ¶
RequestCheck requests check.
func RequestClean ¶
RequestClean requests a clean.
func RequestDisconnect ¶
RequestDisconnect requests a disconnection.
func RequestGetID ¶
RequestGetID gets peer id.
func RequestLookup ¶
RequestLookup requests a lookup.
func RequestPublish ¶
RequestPublish requests publish a random content.
func RequestSetID ¶
RequestSetID sets peer ids.
func WriteError ¶
func WriteError(w http.ResponseWriter, header int, msg string)
WriteError writes an error.
Types ¶
Click to show internal directories.
Click to hide internal directories.