jsonrpc

package
v0.0.0-...-91e0ed7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

JSON-RPC

This package is needed for communication between the Prisma CLI and the invoked generator (generator being the whole Go client package).

Documentation

Overview

Package jsonrpc enables communication with Prisma

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	PrettyName         string   `json:"prettyName"`
	DefaultOutput      string   `json:"defaultOutput"`
	Denylist           []string `json:"denylist"`
	RequiresGenerators []string `json:"requiresGenerators"`
	RequiresEngines    []string `json:"requiresEngines"`
}

Manifest describes information for the Prisma Client Go generator for the Prisma CLI.

type ManifestResponse

type ManifestResponse struct {
	Manifest Manifest `json:"manifest"`
}

ManifestResponse sets the response Prisma Client Go returns when Prisma asks for the Manifest.

type Request

type Request struct {
	// JSONRPC describes the version of the JSON RPC protocol. Defaults to `2.0`.
	JSONRPC string `json:"jsonrpc"`
	// ID identifies a unique request.
	ID int `json:"id"`
	// Method describes the intention of the request.
	Method string `json:"method"`
	// Params contains the payload of the request. Usually parsed into a specific struct for further processing.
	Params json.RawMessage `json:"params"`
}

Request sets a generic JSONRPC request, which wraps information and params.

type Response

type Response struct {
	// JSONRPC describes the version of the JSON RPC protocol. Defaults to `2.0`.
	JSONRPC string `json:"jsonrpc"`
	// ID identifies a unique request.
	ID int `json:"id"`
	// Result contains the payload of the response.
	Result interface{} `json:"result"`
}

Response sets a generic JSONRPC response, which wraps information and a result.

func NewResponse

func NewResponse(id int, result interface{}) Response

NewResponse forms a new JSON RPC response to reply to the Prisma CLI commands

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL