service

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func NewService

func NewService() *Service

func (*Service) BulkCreate

func (svc *Service) BulkCreate(ctx context.Context, objs []*serviceapi.Obj) (objKeys []serviceapi.ObjKey, err error)

BulkCreate creates multiple objects, returning their keys.

func (*Service) BulkDelete

func (svc *Service) BulkDelete(ctx context.Context, objKeys []serviceapi.ObjKey) (deletedKeys []serviceapi.ObjKey, err error)

BulkDelete deletes the objects matching the keys, returning the keys of the deleted objects.

func (*Service) BulkLoad

func (svc *Service) BulkLoad(ctx context.Context, objKeys []serviceapi.ObjKey) (objs []*serviceapi.Obj, err error)

BulkLoad returns the objects matching the keys.

func (*Service) BulkRevise

func (svc *Service) BulkRevise(ctx context.Context, objs []*serviceapi.Obj) (revisedKeys []serviceapi.ObjKey, err error)

BulkRevise updates multiple objects, returning the number of rows affected. Only rows with matching revisions are updated.

func (*Service) BulkStore

func (svc *Service) BulkStore(ctx context.Context, objs []*serviceapi.Obj) (storedKeys []serviceapi.ObjKey, err error)

BulkStore updates multiple objects, returning the keys of the stored objects.

func (*Service) Count

func (svc *Service) Count(ctx context.Context, query serviceapi.Query) (count int, err error)

Count returns the number of objects matching the query, disregarding pagination.

func (*Service) Create

func (svc *Service) Create(ctx context.Context, obj *serviceapi.Obj) (objKey serviceapi.ObjKey, err error)

Create creates a new object, returning its key.

func (*Service) Delete

func (svc *Service) Delete(ctx context.Context, objKey serviceapi.ObjKey) (deleted bool, err error)

Delete deletes the object.

func (*Service) Deployment

func (svc *Service) Deployment() string

func (*Service) List

func (svc *Service) List(ctx context.Context, query serviceapi.Query) (objs []*serviceapi.Obj, totalCount int, err error)

List returns the objects matching the query, and the total count of matches regardless of the limit.

func (*Service) Load

func (svc *Service) Load(ctx context.Context, objKey serviceapi.ObjKey) (obj *serviceapi.Obj, found bool, err error)

Load returns the object associated with the key.

func (*Service) Lookup

func (svc *Service) Lookup(ctx context.Context, query serviceapi.Query) (obj *serviceapi.Obj, found bool, err error)

Lookup returns the single object matching the query. It errors if more than one object matches the query.

func (*Service) MustDelete

func (svc *Service) MustDelete(ctx context.Context, objKey serviceapi.ObjKey) (err error)

MustDelete deletes the object.

func (*Service) MustLoad

func (svc *Service) MustLoad(ctx context.Context, objKey serviceapi.ObjKey) (obj *serviceapi.Obj, err error)

MustLoad returns the object associated with the key. It errors if the object is not found.

func (*Service) MustLookup

func (svc *Service) MustLookup(ctx context.Context, query serviceapi.Query) (obj *serviceapi.Obj, err error)

MustLookup returns the single object matching the query. It errors unless exactly one object matches the query.

func (*Service) MustRevise

func (svc *Service) MustRevise(ctx context.Context, obj *serviceapi.Obj) (err error)

MustRevise updates the object only if the revision matches.

func (*Service) MustStore

func (svc *Service) MustStore(ctx context.Context, obj *serviceapi.Obj) (err error)

MustStore updates the object.

func (*Service) OnShutdown

func (svc *Service) OnShutdown(ctx context.Context) (err error)

OnShutdown is called when the microservice is shut down.

func (*Service) OnStartup

func (svc *Service) OnStartup(ctx context.Context) (err error)

OnStartup is called when the microservice is started up.

func (*Service) Parallel

func (svc *Service) Parallel(args ...any) error

func (*Service) Plane

func (svc *Service) Plane() string

func (*Service) Purge

func (svc *Service) Purge(ctx context.Context, query serviceapi.Query) (deletedKeys []serviceapi.ObjKey, err error)

Purge deletes all objects matching the query, returning the keys of the deleted objects.

func (*Service) ResFS

func (svc *Service) ResFS() fs.FS

func (*Service) Revise

func (svc *Service) Revise(ctx context.Context, obj *serviceapi.Obj) (revised bool, err error)

Revise updates the object only if the revision matches.

func (*Service) SQLDataSourceName

func (svc *Service) SQLDataSourceName() (dsn string)

func (*Service) SetSQLDataSourceName

func (svc *Service) SetSQLDataSourceName(dsn string)

func (*Service) Store

func (svc *Service) Store(ctx context.Context, obj *serviceapi.Obj) (stored bool, err error)

Store updates the object.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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