agent

package
v0.9.12 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RPCAuthMethod       = "auth"
	RPCGroupsMethod     = "groups"
	RPCUnitsMethod      = "units"
	RPCSearchMethod     = "search"
	RPCPingMethod       = "ping"
	RPCGroupUsersMethod = "groupUsers"
	RPCUnitUsersMethod  = "unitUsers"
)
View Source
const (
	ErrUnknown uint8 = iota
	ErrNoAgent
	ErrTimeout
)

noinspection GoUnusedConst

Variables

This section is empty.

Functions

func DefaultRPCFuncs

func DefaultRPCFuncs(client *ldap.Client, ops ...rpcOpt) map[string]RPCFunc

func WithAuth

func WithAuth() func(r *rpcClient)

func WithGroupUsers

func WithGroupUsers() func(r *rpcClient)

func WithGroups

func WithGroups() func(r *rpcClient)

func WithOrganizationalUnits

func WithOrganizationalUnits() func(r *rpcClient)

func WithPing added in v0.9.2

func WithPing() func(r *rpcClient)

func WithSearch

func WithSearch() func(r *rpcClient)

func WithUnitUsers

func WithUnitUsers() func(r *rpcClient)

Types

type LdapClient

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

func Client

func Client(agentID, addr, path string, rpc map[string]RPCFunc) (*LdapClient, error)

func (*LdapClient) Serve

func (c *LdapClient) Serve(ctx context.Context) error

type LdapMsg

type LdapMsg struct {
	GUID   string
	Method string
	Params string
}

type LdapRPC

type LdapRPC func(agentId string, msg LdapMsg) (LdapResp, error)

type LdapResp

type LdapResp struct {
	GUID string
	Data string
	Err  string
}

type LdapServer

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

func Server

func Server(timeout time.Duration) *LdapServer

func (*LdapServer) Close

func (s *LdapServer) Close()

func (*LdapServer) RPC

func (s *LdapServer) RPC(agentID string, msg LdapMsg) (LdapResp, error)

func (*LdapServer) ReachMux

func (s *LdapServer) ReachMux(mux *http.ServeMux, path string)

func (*LdapServer) Run

func (s *LdapServer) Run(ctx context.Context, addr, path string) error

type RPCAuth

type RPCAuth struct {
	Login string
	Pass  string
}

type RPCFunc

type RPCFunc func(params string) (data string, err error)

type RPCNodeUsers

type RPCNodeUsers struct {
	ID     string
	Pag    RPCPag
	PagGql RPCPagGql
}

func (*RPCNodeUsers) LoadPag

func (nu *RPCNodeUsers) LoadPag()

type RPCPag

type RPCPag struct {
	PerPage uint32
	PageNum uint32
}

type RPCPagGql

type RPCPagGql struct {
	PerPage int
	PageNum int
}

func (RPCPagGql) ToPag

func (p RPCPagGql) ToPag() RPCPag

Jump to

Keyboard shortcuts

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