csock

package
Version: v0.0.0-...-e488709 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package csock implements a control socket with a simple human-readable API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSock

type CSock struct {
	// contains filtered or unexported fields
}

func NewCSock

func NewCSock(l net.Listener, cb func(r *Request) *Response) *CSock

NewCSock is a generic initializer. In most cases you want to use NewTCPCSock or NewUnixCSock.

func NewTCPCSock

func NewTCPCSock(addrStr string, cb func(r *Request) *Response) (*CSock, error)

func NewUnixCSock

func NewUnixCSock(path string, cb func(r *Request) *Response) (*CSock, error)

func (*CSock) CanonicalAddr

func (c *CSock) CanonicalAddr() string

func (*CSock) ServeHTTP

func (c *CSock) ServeHTTP(rw http.ResponseWriter, r *http.Request)

func (*CSock) Start

func (c *CSock) Start() error

func (*CSock) Stop

func (c *CSock) Stop() error

type Request

type Request struct {
	SpyName       string `json:"spy_name"`
	ClientName    string `json:"client_name"`
	ClientVersion string `json:"client_version"`
	Command       string `json:"command"`
	Pid           int    `json:"pid"`
	ProfileID     int    `json:"profile_id"`
}

type Response

type Response struct {
	ProfileID int `json:"profile_id"`
}

Jump to

Keyboard shortcuts

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