{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/influxdb-client/issues/2","repository_url":"https://api.github.com/repos/influxdata/influxdb-client","labels_url":"https://api.github.com/repos/influxdata/influxdb-client/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/influxdb-client/issues/2/comments","events_url":"https://api.github.com/repos/influxdata/influxdb-client/issues/2/events","html_url":"https://github.com/influxdata/influxdb-client/pull/2","id":170954989,"number":2,"title":"Initial API proposal","user":{"login":"jsternberg","id":1212129,"avatar_url":"https://avatars.githubusercontent.com/u/1212129?v=3","gravatar_id":"","url":"https://api.github.com/users/jsternberg","html_url":"https://github.com/jsternberg","followers_url":"https://api.github.com/users/jsternberg/followers","following_url":"https://api.github.com/users/jsternberg/following{/other_user}","gists_url":"https://api.github.com/users/jsternberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jsternberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsternberg/subscriptions","organizations_url":"https://api.github.com/users/jsternberg/orgs","repos_url":"https://api.github.com/users/jsternberg/repos","events_url":"https://api.github.com/users/jsternberg/events{/privacy}","received_events_url":"https://api.github.com/users/jsternberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-12T20:40:30Z","updated_at":"2016-08-30T17:15:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/influxdata/influxdb-client/pulls/2","html_url":"https://github.com/influxdata/influxdb-client/pull/2","diff_url":"https://github.com/influxdata/influxdb-client/pull/2.diff","patch_url":"https://github.com/influxdata/influxdb-client/pull/2.patch"},"body":"# Initial API Proposal\r\n\r\nThis initial proposal needs to just be able to do two simple things. It needs to be able to query the database and write to the database.\r\n\r\n## Queries\r\n\r\nThe basic query interface has been modified to just returning the body from the request and building additional parsing functionality on top of that. I thought about creating some kind of response struct or interface, but there were a few different use cases that I had to consider.\r\n\r\n1. Multiple content types so there are multiple ways for a server to return data depending on what format the client asks for.\r\n2. Some content types we will just want the client to print verbatim. JSON and CSV can be printed directly and we will continue doing that with new content types as time goes on. The column format is the only one that will not be done on the server. A client who wants to do that will choose another format and decode the format it asks for. An error will be returned if the server returns a non-200 OK status message or it will return an empty reader if 204 OK was returned instead.\r\n3. We will have convenience methods for parsing the resulting stream.\r\n\r\n```go\r\nc := &influxdb.Client{}\r\nquery, meta, err := c.RawQuery(\"SHOW DATABASES\", &influxdb.QueryOptions{Format: \"json\"})\r\nif err != nil {\r\n    return nil\r\n}\r\n\r\nreader, err := influxdb.NewReader(query, meta)\r\n// read from the query\r\n```\r\n\r\nThis typically gets encapsulated into a `Query()` method that handles this. The user gets access to either make a `RawQuery()` or to make a `Query()` when they want to parse the results. We can change which format we request with `Query()` to the most efficient one we can (such as switching it to msgpack in the future) without any kind of negative.\r\n\r\n## Writer\r\n\r\nWe will want to support multiple methods of writing data. The HTTP client is the most powerful and it needs to support both TCP and UNIX sockets. While UDP is there, it will only accept a hostname and does not need to use a `influxdb.Client` struct since it has no connection to that piece of code. All batch writing interfaces are unified with an `influxdb.Writer` interface along with just having a convenience method on the client itself. The `influxdb.Writer` assumes it will only be writing to one database or retention policy. If they need to write to multiple databases or retention policies, they will need to make multiple writers."},"comment":{"url":"https://api.github.com/repos/influxdata/influxdb-client/issues/comments/243511746","html_url":"https://github.com/influxdata/influxdb-client/pull/2#issuecomment-243511746","issue_url":"https://api.github.com/repos/influxdata/influxdb-client/issues/2","id":243511746,"user":{"login":"jsternberg","id":1212129,"avatar_url":"https://avatars.githubusercontent.com/u/1212129?v=3","gravatar_id":"","url":"https://api.github.com/users/jsternberg","html_url":"https://github.com/jsternberg","followers_url":"https://api.github.com/users/jsternberg/followers","following_url":"https://api.github.com/users/jsternberg/following{/other_user}","gists_url":"https://api.github.com/users/jsternberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jsternberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsternberg/subscriptions","organizations_url":"https://api.github.com/users/jsternberg/orgs","repos_url":"https://api.github.com/users/jsternberg/repos","events_url":"https://api.github.com/users/jsternberg/events{/privacy}","received_events_url":"https://api.github.com/users/jsternberg/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T17:15:05Z","updated_at":"2016-08-30T17:15:05Z","body":"The main difference I had in mind was to expose some parts in the API that weren't previously exposed but to also try to make it fit with how I viewed the API should be used. A primary purpose I had was making it easier to create and write points and to get the raw query result from the server rather than forcing the user to wait for it to parse the entire response. The latter was especially needed since consuming any large amount of input was impossible with the old structure.\r\n\r\nCan you give some more detail about what you did? If it's something that should be built into the library, we should include that authentication in the library itself. If it's something that was special to Kapacitor, maybe we should try exposing the HTTP request objects so the user could modify them if they wanted to."}}
{"actor":{"display_login":"jsternberg"}}