Documentation
¶
Index ¶
- func CORSMiddleware(next http.Handler) http.HandlerFunc
- type BlackboardHTTPService
- func (b *BlackboardHTTPService) BlackboardHandler(w http.ResponseWriter, r *http.Request)
- func (b *BlackboardHTTPService) BlackboardLengthHandler(w http.ResponseWriter, r *http.Request)
- func (b *BlackboardHTTPService) BlackboardSSEHandler(w http.ResponseWriter, r *http.Request)
- func (b *BlackboardHTTPService) MessageHandler(w http.ResponseWriter, r *http.Request)
- func (b *BlackboardHTTPService) NewMessageHandler(w http.ResponseWriter, r *http.Request)
- func (b *BlackboardHTTPService) PostError(msgs ...any)
- func (b *BlackboardHTTPService) PostErrorf(fmt_str string, msgs ...any)
- func (b *BlackboardHTTPService) PostLog(msgs ...any)
- func (b *BlackboardHTTPService) PostLogf(fmt_str string, msgs ...any)
- func (b *BlackboardHTTPService) Shutdown() error
- func (b *BlackboardHTTPService) Start(listen_addr string) error
- func (b *BlackboardHTTPService) TraceHandler(w http.ResponseWriter, r *http.Request)
- type CoreAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORSMiddleware ¶ added in v0.2.6
func CORSMiddleware(next http.Handler) http.HandlerFunc
this enables CORS (https://enable-cors.org)
Types ¶
type BlackboardHTTPService ¶
BlackboardHTTPService is an implementation of CoreAPI for HTTP.
func NewBlackboardHTTPService ¶
func NewBlackboardHTTPService(ctx context.Context, bb blackboards.StreamingBlackboard) *BlackboardHTTPService
NewBlackboardHTTPService creates a new BlackboardHTTPService from a Blackboard.
func (*BlackboardHTTPService) BlackboardHandler ¶
func (b *BlackboardHTTPService) BlackboardHandler(w http.ResponseWriter, r *http.Request)
BlackboardHandler is a handler function for the "/blackboard" endpoint.
func (*BlackboardHTTPService) BlackboardLengthHandler ¶
func (b *BlackboardHTTPService) BlackboardLengthHandler(w http.ResponseWriter, r *http.Request)
BlackboardLengthHandler is a handler function for the "/blackboard/len" endpoint.
func (*BlackboardHTTPService) BlackboardSSEHandler ¶ added in v0.2.6
func (b *BlackboardHTTPService) BlackboardSSEHandler(w http.ResponseWriter, r *http.Request)
func (*BlackboardHTTPService) MessageHandler ¶
func (b *BlackboardHTTPService) MessageHandler(w http.ResponseWriter, r *http.Request)
MessageHandler is a handler function for the "/message/{id}" endpoint.
func (*BlackboardHTTPService) NewMessageHandler ¶
func (b *BlackboardHTTPService) NewMessageHandler(w http.ResponseWriter, r *http.Request)
NewMessageHandler is a handler function for the "/message" endpoint.
func (*BlackboardHTTPService) PostError ¶ added in v0.2.6
func (b *BlackboardHTTPService) PostError(msgs ...any)
func (*BlackboardHTTPService) PostErrorf ¶ added in v0.2.6
func (b *BlackboardHTTPService) PostErrorf(fmt_str string, msgs ...any)
func (*BlackboardHTTPService) PostLog ¶ added in v0.2.6
func (b *BlackboardHTTPService) PostLog(msgs ...any)
func (*BlackboardHTTPService) PostLogf ¶ added in v0.2.6
func (b *BlackboardHTTPService) PostLogf(fmt_str string, msgs ...any)
func (*BlackboardHTTPService) Shutdown ¶
func (b *BlackboardHTTPService) Shutdown() error
Shutdown shuts the blackboard service down.
func (*BlackboardHTTPService) Start ¶
func (b *BlackboardHTTPService) Start(listen_addr string) error
Start is a blocking call to begin listening list_addr.
func (*BlackboardHTTPService) TraceHandler ¶
func (b *BlackboardHTTPService) TraceHandler(w http.ResponseWriter, r *http.Request)
TraceHandler is a handler function for the "/trace" endpoint.
type CoreAPI ¶
This interface is intended to allow us to manage an API layer via the core executable (q: should be defined closer to cmd then?), NOT to dictate what functionality you should expose for for your blackboard. The core-provided apis generally expose all of the desired blackboard functionality.