gleamrpc
Types
pub type GleamRPCError(error) {
GleamRPCError(error: error)
}
Constructors
-
GleamRPCError(error: error)
pub type Procedure(params, return) {
Procedure(
name: String,
router: option.Option(Router),
type_: ProcedureType,
params_type: convert.Converter(params),
return_type: convert.Converter(return),
)
}
Constructors
-
Procedure( name: String, router: option.Option(Router), type_: ProcedureType, params_type: convert.Converter(params), return_type: convert.Converter(return), )
pub type ProcedureCall(params, return, error) {
ProcedureCall(
procedure: Procedure(params, return),
server: ProcedureClient(params, return, error),
)
}
Constructors
-
ProcedureCall( procedure: Procedure(params, return), server: ProcedureClient(params, return, error), )
pub type ProcedureClient(params, return, error) {
ProcedureClient(
call: fn(Procedure(params, return), params) ->
Result(return, GleamRPCError(error)),
)
}
Constructors
-
ProcedureClient( call: fn(Procedure(params, return), params) -> Result(return, GleamRPCError(error)), )
pub type ProcedureType {
Query
Mutation
}
Constructors
-
Query
-
Mutation
Functions
pub fn call(
procedure_call: ProcedureCall(a, b, c),
params: a,
) -> Result(b, GleamRPCError(c))
pub fn params(
procedure: Procedure(a, b),
params_converter: Converter(a),
) -> Procedure(a, b)
pub fn returns(
procedure: Procedure(a, b),
return_converter: Converter(b),
) -> Procedure(a, b)
pub fn with_client(
procedure: Procedure(a, b),
server: ProcedureClient(a, b, c),
) -> ProcedureCall(a, b, c)