coreos / fcos-pinger-backend

Backend for Fedora CoreOS Pinger (https://github.com/coreos/fedora-coreos-pinger)
Apache License 2.0
2 stars 2 forks source link

interface use in json #3

Open ashcrow opened 4 years ago

ashcrow commented 4 years ago

interface{} is used instead of specific types. Ex: https://github.com/zonggen/fcos-pinger-backend/blob/master/main.go#L40 Is this because the data reported isn't known or is it more so a MondoDB driver requirement?

zonggen commented 4 years ago

The main reason I was using interface{} is that the data type might be subject to changes since the client data collection code has not been finalized. So I thought it might be better to accept generic types and change to specific types later.

ashcrow commented 4 years ago

I see. Is there a plan to specify the format of incoming data? I'd hate for someone to shove large amounts of dummy data in to overwhelm the backend.

zonggen commented 4 years ago

Totally understand the concern, I will adjust the types as soon as the client code is ready. Is that okay..

ashcrow commented 4 years ago

I believe so. I'd avoid running it in production until then though (just in case :-))