argus

package
v0.0.0-...-6fd0161 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2019 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HomeUnix

func HomeUnix() (string, error)

HomeUnix() get home path

func NewKey

func NewKey(pubFile string, priFile string) error

func PrivateKeyToString

func PrivateKeyToString(pubk interface{}) (string, error)

PrivateKeyToString convert rsa or ecdsa public key to string

func PublicKeyToString

func PublicKeyToString(pubk interface{}) (string, error)

PublicKeyToString convert rsa or ecdsa public key to string

func Sign

func Sign(hash []byte, private *ecdsa.PrivateKey) ([]byte, error)

func StringToPrivateKey

func StringToPrivateKey(text string) (interface{}, error)

StringToPrivateKey convert string to rsa or ecdsa public key

func StringToPublicKey

func StringToPublicKey(text string) (interface{}, error)

StringToPublicKey convert string to rsa or ecdsa public key

func Verify

func Verify(hash []byte, public *ecdsa.PublicKey, sig string) error

Types

type ArgusClient

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

ArgusClient client object

func NewArgusClient

func NewArgusClient(conf *ClientConfig, publicKey *ecdsa.PublicKey) (*ArgusClient, error)

func (*ArgusClient) Run

func (o *ArgusClient) Run()

type ClientConfig

type ClientConfig struct {
	UID        string `json:"uid"`
	GUID       string `json:"guid"`
	ScriptRoot string `json:"script_root"`
	Label      string `json:"label"`
	ServerURL  string `json:"server_address"`
}

type Config

type Config struct {
	LogPath string `json:"logdir"`
	BDPath  string `json:"dbdir"`
	Address string `json:"address"`
}

Config server config

type Server

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

Server hlkeep server

func NewServer

func NewServer(conf *Config) (*Server, error)

func (*Server) Run

func (o *Server) Run() error

func (*Server) ServeHTTP

func (o *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP http request handler

func (*Server) Shutdown

func (o *Server) Shutdown()

Shutdown to free resource

Jump to

Keyboard shortcuts

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