Skip to content

Instantly share code, notes, and snippets.

@rahulbir
rahulbir / appointmentAction.go
Last active December 8, 2020 19:25
Pseudo code for refactoring appointment_routes
//api-export-action /the/route/here/cancel
func Cancel(request WebRequest) (WebResponse, error){
validateRequest()
// AppointmentRepository is injected here so that we can test CancelConsumerAction by stubbing the interface
result, err := CancelConsumerAction(mapFromWebRequest(request), AppointmentRepository{})
if err return err
return mapToWebResponse(result), nil
}
"{"global":{"LeftronicModel":{"WIDGET_REGISTRY":{},"WIDGET_TYPES":{"1":{"description":"Place a label anywhere on your dashboard. Anywhere!","maxWidth":48,"imageURL":"label.png","streamTypeId":8,"minHeight":1,"maxHeight":1,"widgetTypeId":1,"minWidth":3,"defaultWidth":3,"defaultHeight":1,"params":[{"required":false,"type":"string","name":"Label","value":"LABEL"},{"required":"true","type":"options","name":"Align","value":["Left","Center","Right"]}],"name":"Label"},"2":{"description":"Display a single number, like page views or sign-ups.","maxWidth":48,"imageURL":"number.png","streamTypeId":1,"minHeight":2,"maxHeight":6,"widgetTypeId":2,"minWidth":3,"defaultWidth":3,"defaultHeight":2,"params":[{"required":false,"type":"string","name":"Title","value":""},{"required":false,"type":"boolean","name":"Show Full Number","value":false},{"required":false,"type":"boolean","name":"Invert Trend Colors","value":false}],"name":"Number"},"3":{"description":"Display a number as it builds up to a target. Great for goal-setting!",

Keybase proof

I hereby claim:

  • I am rahulbir on github.
  • I am rahulbir (https://keybase.io/rahulbir) on keybase.
  • I have a public key ASDKBkxfcy6L9pR7AqdwcmJ5zZeJ4pQJ1yLtifUXTRnJ-Ao

To claim this, I am signing this object:

package main
import (
"github.com/leftronic/dataset-api/datasetsvc"
"google.golang.org/grpc"
"context"
"fmt"
"encoding/json"
)