{"id":16226334,"url":"https://github.com/shaozi/gobrctl","last_synced_at":"2025-04-08T03:59:07.371Z","repository":{"id":49427476,"uuid":"377903277","full_name":"shaozi/gobrctl","owner":"shaozi","description":"A go library to get the list of bridges in Linux, same as `brctl show`","archived":false,"fork":false,"pushed_at":"2021-06-17T22:40:53.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-14T02:54:22.057Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shaozi.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":"2021-06-17T16:57:50.000Z","updated_at":"2021-06-26T19:28:31.000Z","dependencies_parsed_at":"2022-08-29T11:31:05.397Z","dependency_job_id":null,"html_url":"https://github.com/shaozi/gobrctl","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaozi%2Fgobrctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaozi%2Fgobrctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaozi%2Fgobrctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaozi%2Fgobrctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shaozi","download_url":"https://codeload.github.com/shaozi/gobrctl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773730,"owners_count":20993633,"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":[],"created_at":"2024-10-10T12:48:47.604Z","updated_at":"2025-04-08T03:59:07.350Z","avatar_url":"https://github.com/shaozi.png","language":"Go","readme":"# Go Library to List Bridges in Linux\n\nThis is a go library that gets a list of bridges. The same as `brctl show`\n\n## Installation\n\nTo install this package, you need to install Go and set your Go workspace first.\n\nThe first need Go installed (version 1.16+ is required), then you can use the below Go command to install gobrctl.\n\n```sh\n$ go get -u github.com/shaozi/gobrctl\n```\n\nImport it in your code:\n\n```go\nimport \"github.com/shaozi/gobrctl\"\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"strings\"\n    \"github.com/shaozi/gobrctl\"\n)\n\n// simulate brctl show\nfunc main() {\n    bridges := gobrctl.GetAllBridges()\n\n    fmt.Println(\"bridge name     bridge id           STP enabled     interfaces\")\n    for _, bridge := range bridges {\n        var stpEnabled string\n        if bridge.Stp {\n            stpEnabled = \"yes\"\n        } else {\n            stpEnabled = \"no\"\n        }\n        fmt.Printf(\"%-16s%-20s%-16s%s\\n\", bridge.Name, bridge.Id, stpEnabled, strings.Join(bridge.Interfaces, \", \"))\n    }\n}\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaozi%2Fgobrctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaozi%2Fgobrctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaozi%2Fgobrctl/lists"}