Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RESTServer ¶
type RESTServer struct {
// contains filtered or unexported fields
}
RESTServer represents a HTTP server
func NewRESTServer ¶
func NewRESTServer(config *RESTServerConfig) *RESTServer
NewRESTServer is a constructor function for RESTServer It returns a pointer to RESTServer
func (RESTServer) ActorBroadcast ¶
func (rs RESTServer) ActorBroadcast(c *gin.Context)
ActorBroadcast godoc
@Summary Broadcast message to actors @Description Broadcast message to actors @Tags actor @Accept json @Produce json @Param message body actor.Envelope true "Message to send" @Success 200 {object} object "received responses" @Failure 400 {object} object "invalid request data" @Failure 500 {object} object "host node hasn't yet been initialized" @Failure 500 {object} object "failed to marshal message" @Failure 500 {object} object "failed to publish message" @Router /actor/broadcast [post]
func (RESTServer) ActorHandle ¶
func (rs RESTServer) ActorHandle(c *gin.Context)
ActorHandle godoc
@Summary Retrieve actor handle @Description Retrieve actor handle with ID, DID, and inbox address @Tags actor @Produce json @Success 200 {object} actor.Handle @Failure 500 {object} object "host node hasn't yet been initialized" @Failure 500 {object} object "handle id is invalid" @Router /actor/handle [get]
func (RESTServer) ActorInvoke ¶
func (rs RESTServer) ActorInvoke(c *gin.Context)
ActorInvoke godoc
@Summary Invoke actor @Description Invoke actor with message @Tags actor @Accept json @Produce json @Param message body actor.Envelope true "Message to send" @Success 200 {object} object "response message" @Failure 400 {object} object "invalid request data" @Failure 500 {object} object "host node hasn't yet been initialized" @Failure 500 {object} object "failed to marshal message" @Failure 500 {object} object "destination address can't be resolved" @Failure 500 {object} object "failed to send message to destination" @Router /actor/invoke [post]
func (RESTServer) ActorSendMessage ¶
func (rs RESTServer) ActorSendMessage(c *gin.Context)
ActorSendMessage godoc
@Summary Send message to actor @Description Send message to actor @Tags actor @Accept json @Produce json @Param message body actor.Envelope true "Message to send" @Success 200 {object} object "message sent" @Failure 400 {object} object "invalid request data" @Failure 500 {object} object "host node hasn't yet been initialized" @Failure 500 {object} object "failed to marshal message" @Failure 500 {object} object "destination address can't be resolved" @Failure 500 {object} object "failed to send message to destination" @Router /actor/send [post]
func (*RESTServer) InitializeRoutes ¶
func (rs *RESTServer) InitializeRoutes()
InitializeRoutes sets up all the endpoint routes
func (*RESTServer) Run ¶
func (rs *RESTServer) Run() error
Run starts the server on the specified port
type RESTServerConfig ¶
type RESTServerConfig struct { P2P *libp2p.Libp2p Onboarding *onboarding.Onboarding Resource types.ResourceManager MidW []gin.HandlerFunc Port uint32 Addr string }
Click to show internal directories.
Click to hide internal directories.