{"id":20110678,"url":"https://github.com/dell/goiscsi","last_synced_at":"2026-02-02T22:51:20.816Z","repository":{"id":38828545,"uuid":"196217181","full_name":"dell/goiscsi","owner":"dell","description":"A portable Go module for iSCSI operations.","archived":false,"fork":false,"pushed_at":"2025-03-27T07:04:39.000Z","size":107,"stargazers_count":8,"open_issues_count":0,"forks_count":10,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-03-31T04:05:28.213Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dell.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-10T14:09:04.000Z","updated_at":"2025-03-27T07:04:42.000Z","dependencies_parsed_at":"2024-02-26T21:25:18.129Z","dependency_job_id":"25fa2c1d-5197-4258-bb42-0f864d0c4cd1","html_url":"https://github.com/dell/goiscsi","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dell%2Fgoiscsi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dell%2Fgoiscsi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dell%2Fgoiscsi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dell%2Fgoiscsi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dell","download_url":"https://codeload.github.com/dell/goiscsi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595334,"owners_count":20963943,"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-11-13T18:13:14.918Z","updated_at":"2026-02-02T22:51:20.801Z","avatar_url":"https://github.com/dell.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :lock: **Important Notice**\r\nStarting with the release of **Container Storage Modules v1.16.0**, this repository will no longer be maintained as an open source project. Future development will continue under a closed source model. This change reflects our commitment to delivering even greater value to our customers by enabling faster innovation and more deeply integrated features with the Dell storage portfolio.\u003cbr\u003e\r\nFor existing customers using Dell’s Container Storage Modules, you will continue to receive:\r\n* **Ongoing Support \u0026 Community Engagement**\u003cbr\u003e\r\n       You will continue to receive high-quality support through Dell Support and our community channels. Your experience of engaging with the Dell community remains unchanged.\r\n* **Streamlined Deployment \u0026 Updates**\u003cbr\u003e\r\n        Deployment and update processes will remain consistent, ensuring a smooth and familiar experience.\r\n* **Access to Documentation \u0026 Resources**\u003cbr\u003e\r\n       All documentation and related materials will remain publicly accessible, providing transparency and technical guidance.\r\n* **Continued Access to Current Open Source Version**\u003cbr\u003e\r\n       The current open-source version will remain available under its existing license for those who rely on it.\r\n\r\nMoving to a closed source model allows Dell’s development team to accelerate feature delivery and enhance integration across our Enterprise Kubernetes Storage solutions ultimately providing a more seamless and robust experience.\u003cbr\u003e\r\nWe deeply appreciate the contributions of the open source community and remain committed to supporting our customers through this transition.\u003cbr\u003e\r\n\r\nFor questions or access requests, please contact the maintainers via [Dell Support](https://www.dell.com/support/kbdoc/en-in/000188046/container-storage-interface-csi-drivers-and-container-storage-modules-csm-how-to-get-support).\r\n\r\n# goiscsi\r\nA portable Go module for iscsi related operations such as discovery and login\r\n\r\n## Features\r\nThe following features are supported:\r\n* Discover iSCSI targets provided by a specific portal, optionally log into each target\r\n* Discover the iSCSI Initiators defined on the local system\r\n* Log into a specific portal/target\r\n* Log out of a specific portal/target\r\n* Rescan all connected iSCSI sessions\r\n\r\n## Implementation options\r\nTwo implementations of the `goiscsi.ISCSIinterface` exist; one is for Linux based systems and one is a mock\r\nimplementation. When instantiating an implementation of the `goiscsi.ISCSIinterface` interface, the factories \r\naccept a `map[string]string` option that allows the user to set specific key/values within the implementation.\r\n\r\nThe `goiscsi.ISCSIinterface` is defined as:\r\n```go\r\ntype ISCSIinterface interface {\r\n\t// Discover the targets exposed via a given portal\r\n\t// returns an array of ISCSITarget instances\r\n\tDiscoverTargets(address string, login bool) ([]ISCSITarget, error)\r\n\r\n\t// Get a list of iSCSI initiators defined in a specified file\r\n\t// To use the system default file of \"/etc/iscsi/initiatorname.iscsi\", provide a filename of \"\"\r\n\tGetInitiators(filename string) ([]string, error)\r\n\r\n\t// Log into a specified target\r\n\tPerformLogin(target ISCSITarget) error\r\n\r\n\t// Log out of a specified target\r\n\tPerformLogout(target ISCSITarget) error\r\n\r\n\t// Rescan current iSCSI sessions\r\n\tPerformRescan() error\r\n\r\n\t// generic implementations\r\n\tisMock() bool\r\n\tgetOptions() map[string]string\r\n}\r\n```\r\n\r\nMany operations deal with iSCSI Targets via a type of `goiscsi.ISCSITarget`, defined as:\r\n```go\r\ntype ISCSITarget struct {\r\n\tPortal   string\r\n\tGroupTag string\r\n\tTarget   string\r\n}\r\n```\r\n\r\n#### LinuxISCSI\r\nWhen instantiating a Linux implementation via `goiscsi.NewLinuxISCSI` the following options are available\r\n\r\n| Key                | Meaning                                                                                 |\r\n|--------------------|-----------------------------------------------------------------------------------------|\r\n| chrootDirectory    | Run `iscsiadm` in a chrooted environment with the root set to this value.               |\r\n|                    | Default is to not chroot                                                                |\r\n\r\n#### MockISCSI\r\nWhen instantiating a mock implementation via `goiscsi.NewMockISCSI`, the follwoing options are available:\r\n\r\n| Key                | Meaning                                                                                                   |\r\n|--------------------|-----------------------------------------------------------------------------------------------------------|\r\n| numberOfInitiators | Defines the number of initiators that will be returned via the `GetInitiators` method.\u003cbr/\u003eDefault is \"1\" |\r\n| numberOfTargets    | Defines the number of targets that will be returned via the `DiscoverTargets` method.\u003cbr/\u003eDefault is \"1\"  |                                                                           \r\n\r\n## Usage examples\r\nThe following example will instantiate a Linux based iSCSI client and Discover the targets exposed via the portal at `address`\r\n\r\n```go\r\nimport (\r\n    \"errors\"\r\n    \r\n    \"github.com/dell/goiscsi\"\r\n)\r\n\r\nfunc printTargets(address string) {\r\n    var c goiscsi.ISCSIinterface\r\n    c := goiscsi.NewLinuxISCSI(map[string]string{})\r\n    targets, err := c.DiscoverTargets(address, false)\r\n    if err != nil {\r\n        return\r\n    }\r\n    for _, t := range targets {\r\n        fmt.Printf(\"Found target: %s\", tgt.Target)\r\n    }\r\n}\r\n```\r\n\r\nThe following example will instantiate a Mock iSCSI client, set the number of targets to 3, and Discover the mocked targets\r\n\r\n```go\r\nimport (\r\n    \"errors\"\r\n    \r\n    \"github.com/dell/goiscsi\"\r\n)\r\n\r\nfunc printTargets(address string) {\r\n    var c goiscsi.ISCSIinterface\r\n    opts := make(map[string]string, 0)\r\n    opts[goiscsi.MockNumberOfTargets] = \"3\"\r\n    c := goiscsi.NewMockISCSI(opts)\r\n    targets, err := c.DiscoverTargets(address, false)\r\n    if err != nil {\r\n        return\r\n    }\r\n    for _, t := range targets {\r\n        fmt.Printf(\"Found target: %s\", tgt.Target)\r\n    }\r\n}\r\n```\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdell%2Fgoiscsi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdell%2Fgoiscsi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdell%2Fgoiscsi/lists"}