services

package
v0.1.57 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigPrefix added in v0.1.56

func GetConfigPrefix(req WithResourceId, userId string) string

func GetConfigPrefixForCloud added in v0.1.56

func GetConfigPrefixForCloud(userId string, cloud commonpb.CloudProvider) string

Types

type CreateRequest

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

type Service

type Service[Arg proto.Message, OutT proto.Message] struct {
	ServiceContext *service_context.ResourceServiceContext
	ResourceName   string
}

func NewService added in v0.1.36

func NewService[Arg proto.Message, OutT proto.Message](resourceName string, db *service_context.ResourceServiceContext) Service[Arg, OutT]

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