{"action":"created","issue":{"url":"https://api.github.com/repos/cavaliercoder/go-zabbix/issues/10","repository_url":"https://api.github.com/repos/cavaliercoder/go-zabbix","labels_url":"https://api.github.com/repos/cavaliercoder/go-zabbix/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/cavaliercoder/go-zabbix/issues/10/comments","events_url":"https://api.github.com/repos/cavaliercoder/go-zabbix/issues/10/events","html_url":"https://github.com/cavaliercoder/go-zabbix/pull/10","id":336014679,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3NTY5Nzc3","number":10,"title":"[Feature] Session caching","user":{"login":"x1unix","id":9203548,"node_id":"MDQ6VXNlcjkyMDM1NDg=","avatar_url":"https://avatars0.githubusercontent.com/u/9203548?v=4","gravatar_id":"","url":"https://api.github.com/users/x1unix","html_url":"https://github.com/x1unix","followers_url":"https://api.github.com/users/x1unix/followers","following_url":"https://api.github.com/users/x1unix/following{/other_user}","gists_url":"https://api.github.com/users/x1unix/gists{/gist_id}","starred_url":"https://api.github.com/users/x1unix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/x1unix/subscriptions","organizations_url":"https://api.github.com/users/x1unix/orgs","repos_url":"https://api.github.com/users/x1unix/repos","events_url":"https://api.github.com/users/x1unix/events{/privacy}","received_events_url":"https://api.github.com/users/x1unix/received_events","type":"User","site_admin":false},"labels":[{"id":976378877,"node_id":"MDU6TGFiZWw5NzYzNzg4Nzc=","url":"https://api.github.com/repos/cavaliercoder/go-zabbix/labels/feature","name":"feature","color":"641da3","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-26T22:31:29Z","updated_at":"2018-06-26T22:47:17Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/cavaliercoder/go-zabbix/pulls/10","html_url":"https://github.com/cavaliercoder/go-zabbix/pull/10","diff_url":"https://github.com/cavaliercoder/go-zabbix/pull/10.diff","patch_url":"https://github.com/cavaliercoder/go-zabbix/pull/10.patch"},"body":"## Changelog\r\n* Introduced caching\r\n  * Added built-in file cache using `SessionFileCache`\r\n  * Session lifetime supported\r\n  * Custom cache support by implementing `SessionAbstractCache` interface\r\n* Added client builder as client setup facade. Used with cache.\r\n\r\n### Checks\r\n#### API\r\n* [x] Abstract cache interface\r\n* [x] File system cache\r\n* [x] Client builder\r\n\r\n#### Unit tests\r\n* [x] File cache\r\n* [x] Client builder\r\n\r\n### Example\r\n```go\r\ncache := zabbix.NewSessionFileCache().SetFilePath(\"./zabbix_session\")\r\nsession, err := zabbix.CreateClient(\"http://zabbix/api_jsonrpc.php\").\r\n\tWithCache(cache).\r\n\tWithCredentials(\"Admin\", \"zabbix\").\r\n\tConnect()\r\n\r\n\r\nfmt.Printf(\"Connected to Zabbix API v%s\", session.Version())\r\n```\r\n\r\n`SessionBuilder.Connect()` will check the cache for cached sessions. If a valid cached session exists - it will provide it, otherwize will connect to Zabbix and will save a session (if cache was provided)."},"comment":{"url":"https://api.github.com/repos/cavaliercoder/go-zabbix/issues/comments/400487229","html_url":"https://github.com/cavaliercoder/go-zabbix/pull/10#issuecomment-400487229","issue_url":"https://api.github.com/repos/cavaliercoder/go-zabbix/issues/10","id":400487229,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMDQ4NzIyOQ==","user":{"login":"cavaliercoder","id":7133556,"node_id":"MDQ6VXNlcjcxMzM1NTY=","avatar_url":"https://avatars0.githubusercontent.com/u/7133556?v=4","gravatar_id":"","url":"https://api.github.com/users/cavaliercoder","html_url":"https://github.com/cavaliercoder","followers_url":"https://api.github.com/users/cavaliercoder/followers","following_url":"https://api.github.com/users/cavaliercoder/following{/other_user}","gists_url":"https://api.github.com/users/cavaliercoder/gists{/gist_id}","starred_url":"https://api.github.com/users/cavaliercoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cavaliercoder/subscriptions","organizations_url":"https://api.github.com/users/cavaliercoder/orgs","repos_url":"https://api.github.com/users/cavaliercoder/repos","events_url":"https://api.github.com/users/cavaliercoder/events{/privacy}","received_events_url":"https://api.github.com/users/cavaliercoder/received_events","type":"User","site_admin":false},"created_at":"2018-06-26T22:47:17Z","updated_at":"2018-06-26T22:47:17Z","author_association":"OWNER","body":"You're welcome! Your last few PRs have been really helpful, and I am so slow at responding. Hopefully the community will get value from you being able to fix things faster."}}
{"actor":{"display_login":"cavaliercoder"}}