# Installation

> The Go package is a cgo layer over the C library, fetched as a module.

`import "github.com/unum-cloud/ustore"` 1.0.0-rc.1 · 084197c4

The Go package is a cgo layer over the C library, fetched as a module:

```sh
go get github.com/unum-cloud/ustore/golang@main
```

A commit pins a build instead of `@main`, and Go records it in `go.sum` as a pseudo-version. The package links `libustore_static` and reads the headers from the module’s own `c/`, so the archive must sit on the linker’s path, such as `/usr/local/lib`, or be named through `CGO_LDFLAGS`. `USTORE_MODALITIES`, set when configuring the archive, lists the modalities it compiles beside blobs, `strings;docs;graph;pages` by default, and `Modality.Compiled` reports whether it holds one, while creating a collection of any other answers `StatusUnsupported`. From a checkout of the repository, for the current shell:

```sh
cmake -B build_release -D CMAKE_BUILD_TYPE=Release
cmake --build build_release --target ustore_static
export CGO_LDFLAGS="-L$PWD/build_release"   # or install the archive
```

Then import the package under the `ustore` name the examples below use:

```go
import ustore "github.com/unum-cloud/ustore/golang"
```

## API

### Functions

#### `Version`

Version reports the major, minor and patch version of the library the program runs against.

[ustore.go:1388 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/ustore.go#L1388)

```go
func Version() (major, minor, patch int)
```

#### `VersionName`

VersionName reports the version of the library the program runs against, pre-release suffix included, such as "1.0.0-rc.1".

[ustore.go:1396 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/ustore.go#L1396)

```go
func VersionName() string
```
