File: response.go

package info (click to toggle)
golang-github-mimuret-golang-iij-dpf 0.9.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,340 kB
  • sloc: makefile: 55
file content (17 lines) | stat: -rw-r--r-- 358 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package testtool

import (
	"strings"

	"github.com/google/uuid"
)

func GenReqID() string {
	return strings.ReplaceAll(strings.ToLower(uuid.New().String()), "-", "")
}

func CreateAsyncResponse() (string, []byte) {
	id := GenReqID()
	bs := []byte(`{"request_id": "` + id + `","jobs_url": "https://dpi.dns-platform.jp/v1/jobs/` + id + `"}`)
	return id, bs
}