Documentation ¶
Index ¶
- func GenerateKeys() (pub string, priv string)
- type Doer
- type InteractionResponse
- type Requester
- type ResponseWriterMock
- func (r ResponseWriterMock) Ack()
- func (r ResponseWriterMock) Autocomplete(i corde.InteractionResponder)
- func (r ResponseWriterMock) DeferedRespond()
- func (r ResponseWriterMock) DeferedUpdate()
- func (r ResponseWriterMock) Modal(m corde.Modal)
- func (r ResponseWriterMock) Respond(i corde.InteractionResponder)
- func (r ResponseWriterMock) Update(i corde.InteractionResponder)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKeys ¶
GenerateKeys generates a new keypair of hex-encoded keys They shouldn't change between runs, but there's a generator just in case
PubK: 2f8c6129d816cf51c374bc7f08c3e63ed156cf78aefb4a6550d97b87997977ee
PrivK: 31323334353637383930313233343536373839303132333435363738393031322f8c6129d816cf51c374bc7f08c3e63ed156cf78aefb4a6550d97b87997977ee
Types ¶
type InteractionResponse ¶
type InteractionResponse struct { Type corde.InteractionType `json:"type"` Data corde.InteractionRespData `json:"data,omitempty"` }
type interaction callback type the type of response data? interaction callback data an optional response message
type Requester ¶
type Requester struct { Client Doer URL string PrivateKey ed25519.PrivateKey }
Requester makes requests to the mock endpoint
func NewWithClient ¶
NewWithClient returns a new mock requester with a default client
func (*Requester) Post ¶
func (r *Requester) Post(body string) (json.RawMessage, error)
PostJSON makes a POST request to the endpoint with the given body
func (*Requester) PostExpect ¶
PostExpect posts a payload and expects a response with the given body
type ResponseWriterMock ¶ added in v0.6.0
type ResponseWriterMock struct { RespondHook func(corde.InteractionResponder) UpdateHook func(corde.InteractionResponder) AutocompleteHook func(corde.InteractionResponder) ModalHook func(corde.Modal) T *testing.T }
ResponseWriterMock mocks corde's ResponseWriter interface
func NewRWMock ¶ added in v0.6.0
func NewRWMock(t *testing.T) ResponseWriterMock
NewRWMock returns a new ResponseWriterMock with the given testing.T
func (ResponseWriterMock) Ack ¶ added in v0.8.0
func (r ResponseWriterMock) Ack()
Pong implements ResponseWriter interface
func (ResponseWriterMock) Autocomplete ¶ added in v0.6.0
func (r ResponseWriterMock) Autocomplete(i corde.InteractionResponder)
Autocomplete implements ResponseWriter interface
func (ResponseWriterMock) DeferedRespond ¶ added in v0.6.0
func (r ResponseWriterMock) DeferedRespond()
DeferedRespond implements ResponseWriter interface
func (ResponseWriterMock) DeferedUpdate ¶ added in v0.6.0
func (r ResponseWriterMock) DeferedUpdate()
DeferedUpdate implements ResponseWriter interface
func (ResponseWriterMock) Modal ¶ added in v0.8.0
func (r ResponseWriterMock) Modal(m corde.Modal)
Modal implements ResponseWriter interface
func (ResponseWriterMock) Respond ¶ added in v0.6.0
func (r ResponseWriterMock) Respond(i corde.InteractionResponder)
Response implements ResponseWriter interface
func (ResponseWriterMock) Update ¶ added in v0.6.0
func (r ResponseWriterMock) Update(i corde.InteractionResponder)
Update implements ResponseWriter interface