hslam_ftok/README.md

47 lines
1.1 KiB
Markdown
Raw Normal View History

2020-11-27 16:46:10 +08:00
# ftok
2020-11-27 17:13:57 +08:00
[![PkgGoDev](https://pkg.go.dev/badge/github.com/hslam/ftok)](https://pkg.go.dev/github.com/hslam/ftok)
2020-11-27 17:47:23 +08:00
[![Build Status](https://travis-ci.org/hslam/ftok.svg?branch=master)](https://travis-ci.org/hslam/ftok)
[![codecov](https://codecov.io/gh/hslam/ftok/branch/master/graph/badge.svg)](https://codecov.io/gh/hslam/ftok)
2020-11-27 17:13:57 +08:00
[![Go Report Card](https://goreportcard.com/badge/github.com/hslam/ftok)](https://goreportcard.com/report/github.com/hslam/ftok)
[![LICENSE](https://img.shields.io/github/license/hslam/ftok.svg?style=flat-square)](https://github.com/hslam/ftok/blob/master/LICENSE)
2020-11-27 16:46:10 +08:00
Package ftok provides a way to generate a System V IPC key, suitable for use with msgget, semget, or shmget.
2020-11-27 17:13:57 +08:00
## Get started
### Install
```
go get github.com/hslam/ftok
```
### Import
```
import "github.com/hslam/ftok"
```
### Usage
#### Example
```go
package main
import (
"fmt"
"github.com/hslam/ftok"
)
func main() {
2020-11-27 17:16:02 +08:00
key, err := ftok.Ftok("/tmp", 0x22)
2020-11-27 17:13:57 +08:00
if err != nil {
return
}
2020-11-27 17:16:02 +08:00
fmt.Printf("%x", key)
2020-11-27 17:13:57 +08:00
}
```
### License
This package is licensed under a MIT license (Copyright (c) 2020 Meng Huang)
### Author
ftok was written by Meng Huang.