api

package
v0.0.0-...-e7dcbf3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: BSD-3-Clause Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetMessagesStats

type GetMessagesStats struct {
	RemoteAddr    string
	Session       robust.Id
	Nick          string
	Started       time.Time
	UserAgent     string
	ForwardedFor  string
	TrustedBridge string
	// contains filtered or unexported fields
}

GetMessageStats encapsulates information about a GetMessages request.

func (GetMessagesStats) NickWithFallback

func (stats GetMessagesStats) NickWithFallback() string

func (GetMessagesStats) StartedAndRelative

func (stats GetMessagesStats) StartedAndRelative() string

StartedAndRelative converts |stats.Started| into a human-readable formatted time, followed by a relative time specification.

type HTTP

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

HTTP provides an HTTP API to RobustIRC, including HTTP handlers for interactive use (e.g. status pages).

func NewHTTP

func NewHTTP(ircServer *ircserver.IRCServer, raftNode *raft.Raft, ircStore *raftstore.LevelDBStore, output *outputstream.OutputStream, transport *rafthttp.HTTPTransport, network string, networkPassword string, raftDir string, peerAddr string, useProtobuf bool, raftProtocolVersion int) *HTTP

NewHTTP creates a new HTTP API handler.

func (*HTTP) ApplyMessageWait

func (api *HTTP) ApplyMessageWait(msg *robust.Message, timeout time.Duration) error

TODO: unexport this, find the correct abstraction layer

func (*HTTP) DispatchPrivate

func (api *HTTP) DispatchPrivate(w http.ResponseWriter, r *http.Request)

func (*HTTP) DispatchPrivateWithoutAuth

func (api *HTTP) DispatchPrivateWithoutAuth(w http.ResponseWriter, r *http.Request)

func (*HTTP) DispatchPublic

func (api *HTTP) DispatchPublic(w http.ResponseWriter, r *http.Request)

func (*HTTP) ReplaceState

func (h *HTTP) ReplaceState(ircServer *ircserver.IRCServer, ircStore *raftstore.LevelDBStore, output *outputstream.OutputStream)

Jump to

Keyboard shortcuts

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