v0.0.3 Latest Latest

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

Go to latest
Published: Jun 11, 2024 License: GPL-3.0 Imports: 14 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Client

type Client struct {
	EndPoint string
	Client   http.Client

Client ...

func (*Client) List

func (c *Client) List(args ListArgs) (*ListReply, error)

List ...

type Config

type Config struct {
	ID          string `json:"id"`
	LoginURL    string `json:"loginURL"`
	Username    string `json:"username"`
	Password    string `json:"password"`
	UserAgent   string `json:"userAgent"`
	UserAgentPw string `json:"userAgentPw"`
	Proxy       string `json:"proxy"`
	RetsVersion string `json:"retsVersion"`

Config ...

func ImportFrom

func ImportFrom(path string) ([]Config, error)

using this to import configs from an existing path walk this path of directories (source id) and extract login []Config from a 'users.json' file at each location

func (Config) Connect

func (c Config) Connect(ctx context.Context, wlog io.Writer) (*Session, error)

Connect ... TODO need to remove connecting from session creation

type ListArgs

type ListArgs struct {
	Name   string `json:"name"`
	Source string `json:"source"`
	Active *bool  `json:"active"`

ListArgs ...

type ListReply

type ListReply struct {
	Configs []Config `json:"configs"`

ListReply ...

type Op

Op is simple Rets function

type RPCService

type RPCService struct {
	Configs func(*ListArgs) ([]Config, error)

RPCService ...

func (*RPCService) List

func (cs *RPCService) List(r *http.Request, args *ListArgs, reply *ListReply) error

List .... curl http://localhost:8888/rpc -H "Content-Type: application/json" -X POST -d '{"id": 1, "method":"ConfigService.List","params":[{}]}'

type Session

type Session struct {
	Config Config // TODO should this be private?
	// contains filtered or unexported fields

Session ...

func (*Session) Close

func (s *Session) Close() error

Close is an io.Closer

func (*Session) Process

func (s *Session) Process(ctx context.Context, ops ...Op) error

Process processes a set of requests

Jump to

Keyboard shortcuts

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