services

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest[Arg proto.Message] interface {
	GetResource() Arg
	proto.Message
}

type Service

type Service[Arg proto.Message, OutT proto.Message] struct {
	Db           *db.Database
	Converters   converter.ResourceConverters[Arg, OutT]
	ResourceName string
}

func (Service[Arg, OutT]) Create

func (s Service[Arg, OutT]) Create(ctx context.Context, in CreateRequest[Arg]) (out OutT, err error)

func (Service[Arg, OutT]) Delete

func (s Service[Arg, OutT]) Delete(ctx context.Context, in WithResourceId) (_ *commonpb.Empty, err error)

func (Service[Arg, OutT]) Read

func (s Service[Arg, OutT]) Read(ctx context.Context, in WithResourceId) (out OutT, err error)

func (Service[Arg, OutT]) Update

func (s Service[Arg, OutT]) Update(ctx context.Context, in UpdateRequest[Arg]) (out OutT, err error)

type UpdateRequest

type UpdateRequest[Arg proto.Message] interface {
	GetResource() Arg
	WithResourceId
}

type WithResourceId

type WithResourceId interface {
	GetResourceId() string
	proto.Message
}

Jump to

Keyboard shortcuts

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