{"id":19177710,"url":"https://github.com/simia-tech/boltx","last_synced_at":"2025-02-23T01:19:11.081Z","repository":{"id":57498098,"uuid":"64762757","full_name":"simia-tech/boltx","owner":"simia-tech","description":"Tools for BoltDB https://github.com/boltdb/bolt","archived":false,"fork":false,"pushed_at":"2017-03-15T11:21:38.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-04T02:48:37.147Z","etag":null,"topics":[],"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/simia-tech.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-08-02T14:14:51.000Z","updated_at":"2017-03-15T11:21:39.000Z","dependencies_parsed_at":"2022-08-28T16:11:17.422Z","dependency_job_id":null,"html_url":"https://github.com/simia-tech/boltx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simia-tech%2Fboltx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simia-tech%2Fboltx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simia-tech%2Fboltx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simia-tech%2Fboltx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simia-tech","download_url":"https://codeload.github.com/simia-tech/boltx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240254562,"owners_count":19772438,"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-09T10:34:42.826Z","updated_at":"2025-02-23T01:19:11.045Z","avatar_url":"https://github.com/simia-tech.png","language":"Go","readme":"# boltx [![Build Status](https://travis-ci.org/simia-tech/boltx.svg?branch=master)](https://travis-ci.org/simia-tech/boltx) [![Coverage Status](https://coveralls.io/repos/github/simia-tech/boltx/badge.svg?branch=master)](https://coveralls.io/github/simia-tech/boltx?branch=master) [![GoDoc](https://godoc.org/github.com/simia-tech/boltx?status.svg)](https://godoc.org/github.com/simia-tech/boltx) [![Go Report Card](https://goreportcard.com/badge/github.com/simia-tech/boltx)](https://goreportcard.com/report/github.com/simia-tech/boltx)\n\n\nThis package contains a collection of tools for [BoltDB](https://github.com/boltdb/bolt). It tries to simplify the\nhandling of models in a BoltDB bucket without being too opinionated.\n\nIt's basically assumes that models implement `encoding.BinaryMarshaler` and `encoding.BinaryUnmarshaler` from Go's\nstandard library.\n\n```go\ntype model struct { ... }\n\nfunc (m *model) MarshalBinary() ([]byte, error) { ... }\n\nfunc (m *model) UnmarshalBinary([]byte) (error) { ... }\n```\n\nThose methods should handle the (de)serialization of the model. The interfaces are than used by the functions of\nthis package to store and load models.\n\n```go\nmodel := \u0026model{}\n\nboltx.PutModel(bucket, []byte(\"key\"), model)\n\nboltx.GetModel(bucket, []byte(\"key\"), model)\n```\n\n## Queue\n\nThe `Queue` helper implements a queue (single-ended) on a bucket. It's persistent and safe to used with\nmultiple goroutines.\n\n```go\nqueue := boltx.NewQueue(db, []byte(\"queue-test\"))\nqueue.EnqueueModel(\u0026model{\"item\"})\n\nmodel := \u0026model{}\nqueue.DequeueModel(model)\n\nlog.Println(model)\n```\n\n## Deque\n\nThe `Deque` helper implements a deque (double-ended queue) on a bucket. It's persistent and safe to use with\nmultiple goroutines.\n\n```go\ndeque := boltx.NewDeque(db, []byte(\"deque-test\"))\n\ngo func () {\n  deque.EnqueueModelBack(\u0026model{\"item\"})\n}()\n\nmodel := \u0026model{}\ndeque.DequeueModelFront(model)\n\nlog.Println(model)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimia-tech%2Fboltx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimia-tech%2Fboltx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimia-tech%2Fboltx/lists"}