{"id":17305802,"url":"https://github.com/s8sg/goshnix","last_synced_at":"2025-03-26T23:27:08.113Z","repository":{"id":57603064,"uuid":"52943298","full_name":"s8sg/goshnix","owner":"s8sg","description":"A powerful Golang Stdlib over SSH for UNIX","archived":false,"fork":false,"pushed_at":"2016-03-07T09:15:39.000Z","size":154,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T02:08:07.778Z","etag":null,"topics":["golang-library","goshnix-client","ssh"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/s8sg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-02T07:33:51.000Z","updated_at":"2018-02-17T20:32:50.000Z","dependencies_parsed_at":"2022-09-26T20:01:42.610Z","dependency_job_id":null,"html_url":"https://github.com/s8sg/goshnix","commit_stats":null,"previous_names":["swarvanusg/goshnix"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s8sg%2Fgoshnix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s8sg%2Fgoshnix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s8sg%2Fgoshnix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s8sg%2Fgoshnix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s8sg","download_url":"https://codeload.github.com/s8sg/goshnix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245751822,"owners_count":20666439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang-library","goshnix-client","ssh"],"created_at":"2024-10-15T11:56:48.437Z","updated_at":"2025-03-26T23:27:08.092Z","avatar_url":"https://github.com/s8sg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# goshnix\n\n![](https://github.com/swarvanusg/goshnix/blob/master/doc/goshnix%20(1).png)\n\nA powerful UNIX utility for performing Golang API over SSH. It abstracts the underlying method for Goshnix supported API, so that your program logic stays same\n\n[![GoDoc](https://img.shields.io/badge/api-Godoc-blue.svg?style=flat-square)](https://godoc.org/github.com/swarvanusg/goshnix)\n\n### Version\n1.0.0\n\n### Get It\n```go\ngo get github.com/swarvanusg/goshnix\n```\n\n\n### Use it  \n##### Initiate Goshnix Client\n```go\ngoshclient, err := goshnix.Init(\"\u003chost_ip\u003e\", \"\u003cport\u003e\", \"\u003cuname\u003e\", \"\u003cpass\u003e\")\n```\n\n##### Use Goshnix Client as a Std Lib\nCheck you environment variable\n```go\nenvval, err := goshclient.Getenv(\"\u003ckey\u003e\")\n```\nGet a file stat\n```go \nfileinfo, _ := goshclient.Stat(\"\u003cfilepath\u003e\")\n// Check if its a dir (as of std lib)\nif fileinfo.IsDir() {\n  // ...\n}\n```\nGet the list of directory entries\n```go\nvar fileinfos []os.FileInfo\nfileinfos, _ := goshclient.ReadDir(\"\u003cdirpath\u003e\")\n```\nFor full listing of supported API see the godoc.\n\n##### Use Goshnix API to Understand Error\nGoshnix returned error could be communication error as well as command execution error. Goshnix provides API to understand proper error sub-type \n```go\nfilecontent, err := goshclient.ReadFile(filename string)\nif err != nil {\n  // Check error type\n  switch {\n  case Isssherror(err):\n    // ssh error handling logic\n  case Iscmderror(err):\n    // cmd error handling logic\n  }\n}\n```\n\n### How it works\nFor each of the API, one or multiple UNIX commands gets executed over ssh to the targeted host.\n\n### License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs8sg%2Fgoshnix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs8sg%2Fgoshnix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs8sg%2Fgoshnix/lists"}