Documentation
¶
Index ¶
- type Call
- type FakeClock
- type FakeServer
- func (f *FakeServer) AddUser(identifier string, password string) *FakeServer
- func (f *FakeServer) AddUserDid(userDid *identity.DIDDocument) *FakeServer
- func (f *FakeServer) Close()
- func (f *FakeServer) Register(method *FakeServerMethod) *FakeServer
- func (f *FakeServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func (f *FakeServer) URL() string
- type FakeServerMethod
- type FakeServerOption
- type FunctionDefinition
- type Post
- type ProcedureDefinition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeServer ¶
type FakeServer struct { // Calls contains information about all the methods that were called in the fake server. Calls []Call // Posts contains all the posts that were published to the server. Posts []Post // contains filtered or unexported fields }
FakeServer is a fake Bluesky server for testing.
func NewFakeServer ¶
func NewFakeServer(options ...FakeServerOption) *FakeServer
NewFakeServer returns a fake Bluesky server for testing.
func (*FakeServer) AddUser ¶
func (f *FakeServer) AddUser(identifier string, password string) *FakeServer
AddUser adds a user that can be authenticated to the server.
func (*FakeServer) AddUserDid ¶
func (f *FakeServer) AddUserDid(userDid *identity.DIDDocument) *FakeServer
AddUserDid adds information about another user on the server.
func (*FakeServer) Register ¶
func (f *FakeServer) Register(method *FakeServerMethod) *FakeServer
Register adds a method to the server.
func (*FakeServer) ServeHTTP ¶
func (f *FakeServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type FakeServerMethod ¶
type FakeServerMethod struct {
// contains filtered or unexported fields
}
FakeServerMethod contains a method that can be registered using Register.
Use NewCommand and NewFunction to create FakeServerMethods.
func NewCommand ¶
func NewCommand[O any](reqType xrpc.XRPCRequestType, name string, def ProcedureDefinition[O]) *FakeServerMethod
NewCommand is used to define a method that doesn't take an input object.
func NewFunction ¶
func NewFunction[I any, O any](reqType xrpc.XRPCRequestType, name string, def FunctionDefinition[I, O]) *FakeServerMethod
NewFunction is used to define a method that takes an input object.
type FakeServerOption ¶
type FakeServerOption func(*FakeServer)
func WithClock ¶
func WithClock(clock k3.Clock) FakeServerOption
WithClock makes the FakeServer use the given clock.
type FunctionDefinition ¶
Click to show internal directories.
Click to hide internal directories.