Documentation
¶
Index ¶
- func HashToken(token string) string
- type AggregatedResponse
- type Client
- func (c *Client) Do(ctx context.Context, method, path string, body io.Reader) (*http.Response, error)
- func (c *Client) Forward(ctx context.Context, method, path string, body io.Reader) ([]byte, int, map[string]string, error)
- func (c *Client) Get(ctx context.Context, path string) ([]byte, int, error)
- func (c *Client) Health(ctx context.Context) error
- func (c *Client) Post(ctx context.Context, path string, body []byte) ([]byte, int, error)
- type DB
- func (db *DB) Close() error
- func (db *DB) ConsumeInvite(tokenHash string, peerName string) error
- func (db *DB) CreateInvite(invite *Invite) (int64, error)
- func (db *DB) CreatePeer(peer *Peer) (int64, error)
- func (db *DB) DeletePeer(name string) error
- func (db *DB) GetInviteByHash(tokenHash string) (*Invite, error)
- func (db *DB) GetPeer(name string) (*Peer, error)
- func (db *DB) ListPeers() ([]Peer, error)
- func (db *DB) UpdateLastSeen(name string) error
- type Invite
- type Manager
- func (m *Manager) AddPeer(name, url, apiKey string) error
- func (m *Manager) DB() *DB
- func (m *Manager) ForEachPeer(ctx context.Context, ...) map[string]Result
- func (m *Manager) GetPeer(name string) (*Client, error)
- func (m *Manager) ListPeers() []PeerStatus
- func (m *Manager) RemovePeer(name string) error
- func (m *Manager) ServerName() string
- func (m *Manager) Start(ctx context.Context) error
- func (m *Manager) Stop()
- type Peer
- type PeerStatus
- type Result
- type ServerResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AggregatedResponse ¶
type AggregatedResponse struct {
Servers map[string]ServerResult `json:"servers"`
}
func AggregateFromPeers ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) DeletePeer ¶
func (*DB) UpdateLastSeen ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) ForEachPeer ¶
func (*Manager) ListPeers ¶
func (m *Manager) ListPeers() []PeerStatus
func (*Manager) RemovePeer ¶
func (*Manager) ServerName ¶
type PeerStatus ¶
type ServerResult ¶
type ServerResult struct {
Name string `json:"name"`
Online bool `json:"online"`
Data json.RawMessage `json:"data,omitempty"`
Error string `json:"error,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.