reader

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

This package is responsible for serving the GraphQL reader API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(
	e *echo.Echo,
	nonodomodel *nonodomodel.NonodoModel,
	convenienceService *services.ConvenienceService,
	adapter Adapter,
)

Register the GraphQL reader API to echo.

Types

type Adapter

type Adapter interface {
	GetReport(reportIndex int, inputIndex int) (*graphql.Report, error)

	GetReports(
		ctx context.Context,
		first *int, last *int, after *string, before *string, inputIndex *int,
	) (*graphql.ReportConnection, error)

	GetInputs(
		ctx context.Context,
		first *int, last *int, after *string, before *string, where *graphql.InputFilter,
	) (*graphql.InputConnection, error)

	GetInput(index int) (*graphql.Input, error)

	GetNotice(noticeIndex int, inputIndex int) (*graphql.Notice, error)

	GetNotices(
		first *int, last *int, after *string, before *string, inputIndex *int,
	) (*graphql.NoticeConnection, error)

	GetVoucher(voucherIndex int, inputIndex int) (*graphql.Voucher, error)

	GetVouchers(
		first *int, last *int, after *string, before *string, inputIndex *int,
	) (*graphql.VoucherConnection, error)

	GetProof(ctx context.Context, inputIndex, outputIndex int) (*graphql.Proof, error)
}

func NewAdapterV1

func NewAdapterV1(
	db *sqlx.DB,
	convenienceService *services.ConvenienceService,
) Adapter

func NewAdapterV2 added in v1.0.1

func NewAdapterV2(
	convenienceService *services.ConvenienceService,
	graphileClient graphile.GraphileClient,
	inputBlobAdapter InputBlobAdapter,
) Adapter

type AdapterV1

type AdapterV1 struct {
	// contains filtered or unexported fields
}

func (AdapterV1) GetInput

func (a AdapterV1) GetInput(index int) (*graphql.Input, error)

func (AdapterV1) GetInputs

func (a AdapterV1) GetInputs(
	ctx context.Context,
	first *int, last *int, after *string, before *string, where *graphql.InputFilter,
) (*graphql.InputConnection, error)

func (AdapterV1) GetNotice

func (a AdapterV1) GetNotice(noticeIndex int, inputIndex int) (*graphql.Notice, error)

func (AdapterV1) GetNotices

func (a AdapterV1) GetNotices(
	first *int,
	last *int,
	after *string,
	before *string,
	inputIndex *int,
) (*graphql.Connection[*graphql.Notice], error)

func (AdapterV1) GetProof added in v1.3.0

func (a AdapterV1) GetProof(ctx context.Context, inputIndex int, outputIndex int) (*graphql.Proof, error)

GetProof implements Adapter.

func (AdapterV1) GetReport

func (a AdapterV1) GetReport(
	reportIndex int, inputIndex int,
) (*graphql.Report, error)

func (AdapterV1) GetReports

func (a AdapterV1) GetReports(
	ctx context.Context,
	first *int, last *int, after *string, before *string, inputIndex *int,
) (*graphql.ReportConnection, error)

func (AdapterV1) GetVoucher

func (a AdapterV1) GetVoucher(voucherIndex int, inputIndex int) (*graphql.Voucher, error)

func (AdapterV1) GetVouchers

func (a AdapterV1) GetVouchers(
	first *int,
	last *int,
	after *string,
	before *string,
	inputIndex *int,
) (*graphql.Connection[*graphql.Voucher], error)

type AdapterV2 added in v1.0.1

type AdapterV2 struct {
	InputBlobAdapter InputBlobAdapter
	// contains filtered or unexported fields
}

func (AdapterV2) GetInput added in v1.0.1

func (a AdapterV2) GetInput(index int) (*graphql.Input, error)

func (AdapterV2) GetInputs added in v1.0.1

func (a AdapterV2) GetInputs(
	ctx context.Context,
	first *int,
	last *int,
	after *string,
	before *string,
	where *graphql.InputFilter) (*graphql.InputConnection, error)

func (AdapterV2) GetNotice added in v1.0.1

func (a AdapterV2) GetNotice(noticeIndex int, inputIndex int) (*graphql.Notice, error)

func (AdapterV2) GetNotices added in v1.0.1

func (a AdapterV2) GetNotices(
	first *int,
	last *int,
	after *string,
	before *string,
	inputIndex *int) (*graphql.NoticeConnection, error)

func (AdapterV2) GetProof added in v1.3.0

func (a AdapterV2) GetProof(ctx context.Context, inputIndex int, outputIndex int) (*graphql.Proof, error)

GetProof implements Adapter.

func (AdapterV2) GetReport added in v1.0.1

func (a AdapterV2) GetReport(reportIndex int, inputIndex int) (*graphql.Report, error)

func (AdapterV2) GetReports added in v1.0.1

func (a AdapterV2) GetReports(
	ctx context.Context,
	first *int,
	last *int,
	after *string,
	before *string,
	inputIndex *int) (*graphql.ReportConnection, error)

func (AdapterV2) GetVoucher added in v1.0.1

func (a AdapterV2) GetVoucher(voucherIndex int, inputIndex int) (*graphql.Voucher, error)

func (AdapterV2) GetVouchers added in v1.0.1

func (a AdapterV2) GetVouchers(
	first *int,
	last *int,
	after *string,
	before *string,
	inputIndex *int) (*graphql.VoucherConnection, error)

type InputBlobAdapter added in v1.0.1

type InputBlobAdapter struct{}

func (*InputBlobAdapter) Adapt added in v1.0.1

func (i *InputBlobAdapter) Adapt(node struct {
	Index  int    `json:"index"`
	Blob   string `json:"blob"`
	Status string `json:"status"`
}) (*graphql.Input, error)

type InputByIdResponse added in v1.0.1

type InputByIdResponse struct {
	Data struct {
		Inputs struct {
			Edges []struct {
				Node struct {
					Index  int    `json:"index"`
					Blob   string `json:"blob"`
					Status string `json:"status"`
				} `json:"node"`
			} `json:"edges"`
		} `json:"inputs"`
	} `json:"data"`
}

type ProofByIndexes added in v1.3.0

type ProofByIndexes struct {
	Data struct {
		Proof graphql.Proof
	}
}

type ReportByIdResponse added in v1.0.1

type ReportByIdResponse struct {
	Data struct {
		Reports struct {
			Edges []struct {
				Node struct {
					Index      int    `json:"index"`
					Blob       string `json:"blob"`
					InputIndex int    `json:"inputIndex"`
				} `json:"node"`
			} `json:"edges"`
		} `json:"reports"`
	} `json:"data"`
}

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

func (*Resolver) Input

func (r *Resolver) Input() graph.InputResolver

Input returns graph.InputResolver implementation.

func (*Resolver) Notice

func (r *Resolver) Notice() graph.NoticeResolver

Notice returns graph.NoticeResolver implementation.

func (*Resolver) Query

func (r *Resolver) Query() graph.QueryResolver

Query returns graph.QueryResolver implementation.

func (*Resolver) Report

func (r *Resolver) Report() graph.ReportResolver

Report returns graph.ReportResolver implementation.

func (*Resolver) Voucher

func (r *Resolver) Voucher() graph.VoucherResolver

Voucher returns graph.VoucherResolver implementation.

Directories

Path Synopsis
This module is a wrapper for the nonodo model that converts the internal types to GraphQL-compatible types.
This module is a wrapper for the nonodo model that converts the internal types to GraphQL-compatible types.

Jump to

Keyboard shortcuts

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