Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/houseme/feie

Flying Goose Cloud print go language sdk
https://github.com/houseme/feie

cloud-print feie feie-cloud feieyun go golang houseme printer sdk sdk-go

Last synced: 9 days ago
JSON representation

Flying Goose Cloud print go language sdk

Awesome Lists containing this project

README

        

# FeiE Printer SDK for Golang

[![Go Reference](https://pkg.go.dev/badge/github.com/houseme/feie.svg)](https://pkg.go.dev/github.com/houseme/feie)
[![FEIE-CI](https://github.com/houseme/feie/actions/workflows/go.yml/badge.svg)](https://github.com/houseme/feie/actions/workflows/go.yml)
![GitHub](https://img.shields.io/github/license/houseme/feie?style=flat-square)
![GitHub go.mod Go version (branch)](https://img.shields.io/github/go-mod/go-version/houseme/feie/main?style=flat-square)

Flying Goose Cloud print go language sdk

## Installation

```bash
go get -u -v github.com/houseme/feie@main
```

## Usage

```go
package main

import (
"context"
"fmt"

"github.com/houseme/feie"
)

func main() {
ctx := context.Background()
c := feie.New(ctx, feie.WithUser("xxxxx"), feie.WithUserKey("xxxxx"))

// 通过SetUserKey设置用户key 和 操作方法中user参数覆盖new方法传入的 User和UserKey
// 设置用户key
c.SetUserKey("xxxxx")
// 添加打印机
printerAddResp, err := c.OpenPrinterAddList(ctx, &feie.PrinterAddReq{
PrinterContent: "xxxxxx",
User: "xxxxx",
})

if err != nil {
panic(err)
}
fmt.Println("PrinterAddResp:", printerAddResp)
// Reset 重置 User和UserKey 前提是new方法传入的 User和UserKey不为空
c.Reset()

// 执行打印
printMsgReq, err := c.OpenPrintMsg(ctx, &feie.PrintMsgReq{
SN: "xxxxx",
Content: "xxxxx",
User: "xxxxx",
})
if err != nil {
panic(err)
}
fmt.Println("PrintMsgResp:", printMsgReq)
}

```

## License
FeiE is primarily distributed under the terms of both the [Apache License (Version 2.0)](LICENSE)