package serializer type Response struct { Status int `json:"status"` Data interface{} `json:"data"` Msg string `json:"msg"` Error string `json:"error"` } type TokenData struct { User interface{} `json:"user"` Token string `json:"tokens"` } type AdminToken struct { Admin interface{} `json:"admin"` Token string `json:"tokens"` } type BossToken struct { Boss interface{} `json:"boss"` Token string `json:"tokens"` } type DataList struct { Item interface{} `json:"item"` Total uint `json:"total"` } func BuildListResponse(items interface{}, total uint) Response { return Response{ Status: 200, Data: DataList{ Item: items, Total: total, }, Msg: "ok", } }