{"id":24540008,"url":"https://github.com/spurtcms/channels","last_synced_at":"2025-10-25T03:02:40.964Z","repository":{"id":232187120,"uuid":"781823226","full_name":"spurtcms/channels","owner":"spurtcms","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-29T13:43:52.000Z","size":181,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-10-29T16:13:09.689Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spurtcms.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-04T05:29:10.000Z","updated_at":"2024-10-29T13:42:57.000Z","dependencies_parsed_at":"2024-04-15T16:00:48.850Z","dependency_job_id":"ff7b0caf-3025-4830-b0cb-fd946c4b8d7e","html_url":"https://github.com/spurtcms/channels","commit_stats":null,"previous_names":["spurtcms/channels"],"tags_count":61,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spurtcms%2Fchannels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spurtcms%2Fchannels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spurtcms%2Fchannels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spurtcms%2Fchannels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spurtcms","download_url":"https://codeload.github.com/spurtcms/channels/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826778,"owners_count":20354220,"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":"2025-01-22T17:17:52.582Z","updated_at":"2025-10-25T03:02:35.923Z","avatar_url":"https://github.com/spurtcms.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Channels Package\n\nThe Channels work in harmony to enhance content management in websites. Channels provide structured containers for organizing diverse data, each tailored to a specific content type. Our Channels package offers a robust solution for organizing and managing data within your Golang projects, providing a structured framework for seamless information storage and retrieval.\n\n\n## Features\n\n- Enables retrieving channels, fetching channels based on user permissions, and obtaining details about specific channels by their IDs.  \n- Administrators can create, edit, and delete channels, as well as modify their status.\n- Facilitates the management of channel entries by allowing administrators to retrieve all entries across channels, fetch published entries, create new entries, and delete existing ones.\n- Retrieving additional field data for specific channels, fetching details about individual entries by their IDs, updating entry details, modifying entry statuses.\n- Retrieval of master field types for channels and provides a list of channels for display on the admin dashboard.\n\n\n\n# Installation\n\n``` bash\ngo get github.com/spurtcms/channels\n```\n\n\n# Usage Example\n``` bash\nimport(\n\t\"github.com/spurtcms/auth\"\n\t\"github.com/spurtcms/channel\"\n)\n\nfunc main() {\n\n\tAuth := auth.AuthSetup(auth.Config{\n\t\tUserId:     1,\n\t\tExpiryTime: 2,\n\t\tSecretKey:  SecretKey,\n\t})\n\n\ttoken, _ := Auth.CreateToken()\n\n\tAuth.VerifyToken(token, SecretKey)\n\n\tpermisison, _ := Auth.IsGranted(\"Channels\", auth.CRUD)\n\n\tchannel := ChannelSetup(Config{\n\t\tDB:               \u0026gorm.DB{},\n\t\tAuthEnable:       true,\n\t\tPermissionEnable: true,\n\t\tAuth:             Auth,\n\t})\n\n\t//channels\n\tif permisison {\n\n\t\t//list channel\n\t\tchannellist, count, err := channel.ListChannel(10, 0, Filter{Keyword: \"\"}, true, true)\n\t\tfmt.Println(channellist, count, err)\n\n\t\t//create channel\n\t\tcchannel, err := channel.CreateChannel(ChannelCreate{ChannelName: \"demo\", ChannelDescription: \"demo\", CategoryIds: []string{\"56,77\"}, CreatedBy: 1},1,1)\n\t\tfmt.Println(cchannel, err)\n\n\t\t//update channel\n\t\tuerr := channel.EditChannel(\"demo2\", \"demo2\", 2, 1, []string{\"55,44\"},1)\n\t\tfmt.Println(uerr)\n\n\t\t//delete channel\n\t\tderr := channel.DeleteChannel(1, 1,\"\",1)\n\t\tfmt.Println(derr)\n\n\t\t//create additionfield\n\t\tfield1value := Fiedlvalue{FieldName: \"text\", MasterFieldId: 2, OrderIndex: 1, IconPath: \"/public/img/text.svg\"}\n\t\tfield2value := Fiedlvalue{FieldName: \"date\u0026time\", MasterFieldId: 4, OrderIndex: 2, IconPath: \"/public/img/date-time.svg\",DateFormat: \"DD/MM/YYYY\",TimeFormat: \"12\"}\n\n\t\terr := channel.CreateAdditionalFields(ChannelAddtionalField{FieldValues: []Fiedlvalue{field1value, field2value}, CreatedBy: 1}, 10, 1)\n\n\t\tif err != nil {\n\n\t\t\tpanic(err)\n\t\t}\n\n\t}\n\n\tcpermisison, _ := Auth.IsGranted(\"Entries\", auth.CRUD)\n\n\tif cpermisison {\n\n\t\t//channelentries list\n\t\tentries, filtercount, overallcount, err := channel.ChannelEntriesList(Entries{\n\t\t\tChannelId:                1,\n\t\t\tLimit:                    10,\n\t\t\tOffset:                   0,\n\t\t\tKeyword:                  \"\",\n\t\t\tChannelName:              \"\",\n\t\t\tSelectedCategoryFilter:   true,\n\t\t\tPublishedonly:            true,\n\t\t\tActiveChannelEntriesonly: true,\n\t\t\tMemberProfile:            true,\n\t\t},1)\n\n\t\tfmt.Println(entries, filtercount, overallcount, err)\n\n\t\t//create entry\n\t\tentries, flg, err := channel.CreateEntry(EntriesRequired{Title: \"golang\", Content: \"about go\", ChannelId: 1,CreatedBy: 1}, 1)\n\n\t\tif err != nil {\n\n\t\t\tpanic(err)\n\t\t}\n\n\t\tfmt.Println(entry, flg, err)\n\n\t\t//update entry\n\t\tchannel.UpdateEntry(EntriesRequired{\n\t\t\tTitle:      \"demo2\",\n\t\t\tContent:    \"demo2\",\n\t\t\tCoverImage: \"\",\n\t\t}, \"demo\", 1,1)\n\n\t\t//delete entry\n\t\tflg, derr := channel.DeleteEntry(\"demo\", 1, 1,1)\n\n\t\tif derr != nil {\n\n\t\t\tfmt.Println(derr)\n\t\t}\n\n\t}\n}\n\n```\n\n\n\n\n# Getting help\nIf you encounter a problem with the package,please refer [Please refer [(https://www.spurtcms.com/documentation/cms-admin)] or you can create a new Issue in this repo[https://github.com/spurtcms/channels/issues]. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspurtcms%2Fchannels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspurtcms%2Fchannels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspurtcms%2Fchannels/lists"}