mirror of
https://github.com/hanzoai/annotations.git
synced 2026-10-30 18:48:18 +00:00
1203 lines
37 KiB
Go
1203 lines
37 KiB
Go
// Code generated by zapgen; DO NOT EDIT.
|
|
// source: annotations.zap
|
|
|
|
package ann
|
|
|
|
import (
|
|
zap "github.com/zap-proto/go"
|
|
)
|
|
|
|
const (
|
|
queueIdOff = 0
|
|
queueProjectOff = 8
|
|
queueNameOff = 16
|
|
queueDescriptionOff = 24
|
|
queueScoreConfigIdsOff = 32
|
|
queueCreatedAtOff = 40
|
|
queueCountCompletedItemsOff = 48
|
|
queueCountPendingItemsOff = 56
|
|
queueIsCurrentUserAssignOff = 64
|
|
queueSize = 65
|
|
)
|
|
|
|
// Queue is a zero-copy view into a ZAP-encoded Queue message.
|
|
type Queue struct{ o zap.Object }
|
|
|
|
// WrapQueue parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapQueue(b []byte) (Queue, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return Queue{}, err
|
|
}
|
|
return Queue{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t Queue) Id() string { return t.o.Text(queueIdOff) }
|
|
func (t Queue) Project() string { return t.o.Text(queueProjectOff) }
|
|
func (t Queue) Name() string { return t.o.Text(queueNameOff) }
|
|
func (t Queue) Description() string { return t.o.Text(queueDescriptionOff) }
|
|
func (t Queue) ScoreConfigIds() zap.List { return t.o.List(queueScoreConfigIdsOff) }
|
|
func (t Queue) CreatedAt() int64 { return t.o.Int64(queueCreatedAtOff) }
|
|
func (t Queue) CountCompletedItems() uint64 { return t.o.Uint64(queueCountCompletedItemsOff) }
|
|
func (t Queue) CountPendingItems() uint64 { return t.o.Uint64(queueCountPendingItemsOff) }
|
|
func (t Queue) IsCurrentUserAssign() bool { return t.o.Bool(queueIsCurrentUserAssignOff) }
|
|
|
|
// QueueInput collects the field values for NewQueue.
|
|
type QueueInput struct {
|
|
Id string
|
|
Project string
|
|
Name string
|
|
Description string
|
|
ScoreConfigIds [][]byte
|
|
CreatedAt int64
|
|
CountCompletedItems uint64
|
|
CountPendingItems uint64
|
|
IsCurrentUserAssign bool
|
|
}
|
|
|
|
// NewQueue builds a ZAP-encoded Queue message from in and returns the bytes.
|
|
func NewQueue(in QueueInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(queueSize)
|
|
ob.SetText(queueIdOff, in.Id)
|
|
ob.SetText(queueProjectOff, in.Project)
|
|
ob.SetText(queueNameOff, in.Name)
|
|
ob.SetText(queueDescriptionOff, in.Description)
|
|
scoreConfigIdsLB := b.StartList(0)
|
|
for _, elem := range in.ScoreConfigIds {
|
|
scoreConfigIdsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(queueScoreConfigIdsOff, scoreConfigIdsLB.FinishOffset(), len(in.ScoreConfigIds))
|
|
ob.SetUint64(queueCreatedAtOff, uint64(in.CreatedAt))
|
|
ob.SetUint64(queueCountCompletedItemsOff, in.CountCompletedItems)
|
|
ob.SetUint64(queueCountPendingItemsOff, in.CountPendingItems)
|
|
ob.SetBool(queueIsCurrentUserAssignOff, in.IsCurrentUserAssign)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
queueItemIdOff = 0
|
|
queueItemProjectOff = 8
|
|
queueItemQueueIdOff = 16
|
|
queueItemObjectIdOff = 24
|
|
queueItemObjectTypeOff = 32
|
|
queueItemStatusOff = 40
|
|
queueItemCreatedAtOff = 48
|
|
queueItemCompletedAtOff = 56
|
|
queueItemLockedAtOff = 64
|
|
queueItemLockedByUserIdOff = 72
|
|
queueItemLockedByUserOff = 80
|
|
queueItemAnnotatorUserIdOff = 88
|
|
queueItemParentTraceIdOff = 96
|
|
queueItemSize = 104
|
|
)
|
|
|
|
// QueueItem is a zero-copy view into a ZAP-encoded QueueItem message.
|
|
type QueueItem struct{ o zap.Object }
|
|
|
|
// WrapQueueItem parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapQueueItem(b []byte) (QueueItem, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return QueueItem{}, err
|
|
}
|
|
return QueueItem{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t QueueItem) Id() string { return t.o.Text(queueItemIdOff) }
|
|
func (t QueueItem) Project() string { return t.o.Text(queueItemProjectOff) }
|
|
func (t QueueItem) QueueId() string { return t.o.Text(queueItemQueueIdOff) }
|
|
func (t QueueItem) ObjectId() string { return t.o.Text(queueItemObjectIdOff) }
|
|
func (t QueueItem) ObjectType() string { return t.o.Text(queueItemObjectTypeOff) }
|
|
func (t QueueItem) Status() string { return t.o.Text(queueItemStatusOff) }
|
|
func (t QueueItem) CreatedAt() int64 { return t.o.Int64(queueItemCreatedAtOff) }
|
|
func (t QueueItem) CompletedAt() int64 { return t.o.Int64(queueItemCompletedAtOff) }
|
|
func (t QueueItem) LockedAt() int64 { return t.o.Int64(queueItemLockedAtOff) }
|
|
func (t QueueItem) LockedByUserId() string { return t.o.Text(queueItemLockedByUserIdOff) }
|
|
func (t QueueItem) LockedByUser() string { return t.o.Text(queueItemLockedByUserOff) }
|
|
func (t QueueItem) AnnotatorUserId() string { return t.o.Text(queueItemAnnotatorUserIdOff) }
|
|
func (t QueueItem) ParentTraceId() string { return t.o.Text(queueItemParentTraceIdOff) }
|
|
|
|
// QueueItemInput collects the field values for NewQueueItem.
|
|
type QueueItemInput struct {
|
|
Id string
|
|
Project string
|
|
QueueId string
|
|
ObjectId string
|
|
ObjectType string
|
|
Status string
|
|
CreatedAt int64
|
|
CompletedAt int64
|
|
LockedAt int64
|
|
LockedByUserId string
|
|
LockedByUser string
|
|
AnnotatorUserId string
|
|
ParentTraceId string
|
|
}
|
|
|
|
// NewQueueItem builds a ZAP-encoded QueueItem message from in and returns the bytes.
|
|
func NewQueueItem(in QueueItemInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(queueItemSize)
|
|
ob.SetText(queueItemIdOff, in.Id)
|
|
ob.SetText(queueItemProjectOff, in.Project)
|
|
ob.SetText(queueItemQueueIdOff, in.QueueId)
|
|
ob.SetText(queueItemObjectIdOff, in.ObjectId)
|
|
ob.SetText(queueItemObjectTypeOff, in.ObjectType)
|
|
ob.SetText(queueItemStatusOff, in.Status)
|
|
ob.SetUint64(queueItemCreatedAtOff, uint64(in.CreatedAt))
|
|
ob.SetUint64(queueItemCompletedAtOff, uint64(in.CompletedAt))
|
|
ob.SetUint64(queueItemLockedAtOff, uint64(in.LockedAt))
|
|
ob.SetText(queueItemLockedByUserIdOff, in.LockedByUserId)
|
|
ob.SetText(queueItemLockedByUserOff, in.LockedByUser)
|
|
ob.SetText(queueItemAnnotatorUserIdOff, in.AnnotatorUserId)
|
|
ob.SetText(queueItemParentTraceIdOff, in.ParentTraceId)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
assignmentUserIdOff = 0
|
|
assignmentNameOff = 8
|
|
assignmentEmailOff = 16
|
|
assignmentSize = 24
|
|
)
|
|
|
|
// Assignment is a zero-copy view into a ZAP-encoded Assignment message.
|
|
type Assignment struct{ o zap.Object }
|
|
|
|
// WrapAssignment parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapAssignment(b []byte) (Assignment, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return Assignment{}, err
|
|
}
|
|
return Assignment{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t Assignment) UserId() string { return t.o.Text(assignmentUserIdOff) }
|
|
func (t Assignment) Name() string { return t.o.Text(assignmentNameOff) }
|
|
func (t Assignment) Email() string { return t.o.Text(assignmentEmailOff) }
|
|
|
|
// AssignmentInput collects the field values for NewAssignment.
|
|
type AssignmentInput struct {
|
|
UserId string
|
|
Name string
|
|
Email string
|
|
}
|
|
|
|
// NewAssignment builds a ZAP-encoded Assignment message from in and returns the bytes.
|
|
func NewAssignment(in AssignmentInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(assignmentSize)
|
|
ob.SetText(assignmentUserIdOff, in.UserId)
|
|
ob.SetText(assignmentNameOff, in.Name)
|
|
ob.SetText(assignmentEmailOff, in.Email)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
queueRefIdOff = 0
|
|
queueRefNameOff = 8
|
|
queueRefSize = 16
|
|
)
|
|
|
|
// QueueRef is a zero-copy view into a ZAP-encoded QueueRef message.
|
|
type QueueRef struct{ o zap.Object }
|
|
|
|
// WrapQueueRef parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapQueueRef(b []byte) (QueueRef, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return QueueRef{}, err
|
|
}
|
|
return QueueRef{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t QueueRef) Id() string { return t.o.Text(queueRefIdOff) }
|
|
func (t QueueRef) Name() string { return t.o.Text(queueRefNameOff) }
|
|
|
|
// QueueRefInput collects the field values for NewQueueRef.
|
|
type QueueRefInput struct {
|
|
Id string
|
|
Name string
|
|
}
|
|
|
|
// NewQueueRef builds a ZAP-encoded QueueRef message from in and returns the bytes.
|
|
func NewQueueRef(in QueueRefInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(queueRefSize)
|
|
ob.SetText(queueRefIdOff, in.Id)
|
|
ob.SetText(queueRefNameOff, in.Name)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
queueObjectHitQueueIdOff = 0
|
|
queueObjectHitQueueNameOff = 8
|
|
queueObjectHitItemIdOff = 16
|
|
queueObjectHitStatusOff = 24
|
|
queueObjectHitSize = 32
|
|
)
|
|
|
|
// QueueObjectHit is a zero-copy view into a ZAP-encoded QueueObjectHit message.
|
|
type QueueObjectHit struct{ o zap.Object }
|
|
|
|
// WrapQueueObjectHit parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapQueueObjectHit(b []byte) (QueueObjectHit, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return QueueObjectHit{}, err
|
|
}
|
|
return QueueObjectHit{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t QueueObjectHit) QueueId() string { return t.o.Text(queueObjectHitQueueIdOff) }
|
|
func (t QueueObjectHit) QueueName() string { return t.o.Text(queueObjectHitQueueNameOff) }
|
|
func (t QueueObjectHit) ItemId() string { return t.o.Text(queueObjectHitItemIdOff) }
|
|
func (t QueueObjectHit) Status() string { return t.o.Text(queueObjectHitStatusOff) }
|
|
|
|
// QueueObjectHitInput collects the field values for NewQueueObjectHit.
|
|
type QueueObjectHitInput struct {
|
|
QueueId string
|
|
QueueName string
|
|
ItemId string
|
|
Status string
|
|
}
|
|
|
|
// NewQueueObjectHit builds a ZAP-encoded QueueObjectHit message from in and returns the bytes.
|
|
func NewQueueObjectHit(in QueueObjectHitInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(queueObjectHitSize)
|
|
ob.SetText(queueObjectHitQueueIdOff, in.QueueId)
|
|
ob.SetText(queueObjectHitQueueNameOff, in.QueueName)
|
|
ob.SetText(queueObjectHitItemIdOff, in.ItemId)
|
|
ob.SetText(queueObjectHitStatusOff, in.Status)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
projectScopeProjectOff = 0
|
|
projectScopeSize = 8
|
|
)
|
|
|
|
// ProjectScope is a zero-copy view into a ZAP-encoded ProjectScope message.
|
|
type ProjectScope struct{ o zap.Object }
|
|
|
|
// WrapProjectScope parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapProjectScope(b []byte) (ProjectScope, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ProjectScope{}, err
|
|
}
|
|
return ProjectScope{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ProjectScope) Project() string { return t.o.Text(projectScopeProjectOff) }
|
|
|
|
// ProjectScopeInput collects the field values for NewProjectScope.
|
|
type ProjectScopeInput struct {
|
|
Project string
|
|
}
|
|
|
|
// NewProjectScope builds a ZAP-encoded ProjectScope message from in and returns the bytes.
|
|
func NewProjectScope(in ProjectScopeInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(projectScopeSize)
|
|
ob.SetText(projectScopeProjectOff, in.Project)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
pageProjectOff = 0
|
|
pageLimitOff = 8
|
|
pagePageOff = 12
|
|
pageSize = 16
|
|
)
|
|
|
|
// Page is a zero-copy view into a ZAP-encoded Page message.
|
|
type Page struct{ o zap.Object }
|
|
|
|
// WrapPage parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapPage(b []byte) (Page, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return Page{}, err
|
|
}
|
|
return Page{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t Page) Project() string { return t.o.Text(pageProjectOff) }
|
|
func (t Page) Limit() uint32 { return t.o.Uint32(pageLimitOff) }
|
|
func (t Page) Page() uint32 { return t.o.Uint32(pagePageOff) }
|
|
|
|
// PageInput collects the field values for NewPage.
|
|
type PageInput struct {
|
|
Project string
|
|
Limit uint32
|
|
Page uint32
|
|
}
|
|
|
|
// NewPage builds a ZAP-encoded Page message from in and returns the bytes.
|
|
func NewPage(in PageInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(pageSize)
|
|
ob.SetText(pageProjectOff, in.Project)
|
|
ob.SetUint32(pageLimitOff, in.Limit)
|
|
ob.SetUint32(pagePageOff, in.Page)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
queueLookupProjectOff = 0
|
|
queueLookupQueueIdOff = 8
|
|
queueLookupSize = 16
|
|
)
|
|
|
|
// QueueLookup is a zero-copy view into a ZAP-encoded QueueLookup message.
|
|
type QueueLookup struct{ o zap.Object }
|
|
|
|
// WrapQueueLookup parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapQueueLookup(b []byte) (QueueLookup, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return QueueLookup{}, err
|
|
}
|
|
return QueueLookup{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t QueueLookup) Project() string { return t.o.Text(queueLookupProjectOff) }
|
|
func (t QueueLookup) QueueId() string { return t.o.Text(queueLookupQueueIdOff) }
|
|
|
|
// QueueLookupInput collects the field values for NewQueueLookup.
|
|
type QueueLookupInput struct {
|
|
Project string
|
|
QueueId string
|
|
}
|
|
|
|
// NewQueueLookup builds a ZAP-encoded QueueLookup message from in and returns the bytes.
|
|
func NewQueueLookup(in QueueLookupInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(queueLookupSize)
|
|
ob.SetText(queueLookupProjectOff, in.Project)
|
|
ob.SetText(queueLookupQueueIdOff, in.QueueId)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
queuePageProjectOff = 0
|
|
queuePageQueueIdOff = 8
|
|
queuePageLimitOff = 16
|
|
queuePagePageOff = 20
|
|
queuePageSize = 24
|
|
)
|
|
|
|
// QueuePage is a zero-copy view into a ZAP-encoded QueuePage message.
|
|
type QueuePage struct{ o zap.Object }
|
|
|
|
// WrapQueuePage parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapQueuePage(b []byte) (QueuePage, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return QueuePage{}, err
|
|
}
|
|
return QueuePage{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t QueuePage) Project() string { return t.o.Text(queuePageProjectOff) }
|
|
func (t QueuePage) QueueId() string { return t.o.Text(queuePageQueueIdOff) }
|
|
func (t QueuePage) Limit() uint32 { return t.o.Uint32(queuePageLimitOff) }
|
|
func (t QueuePage) Page() uint32 { return t.o.Uint32(queuePagePageOff) }
|
|
|
|
// QueuePageInput collects the field values for NewQueuePage.
|
|
type QueuePageInput struct {
|
|
Project string
|
|
QueueId string
|
|
Limit uint32
|
|
Page uint32
|
|
}
|
|
|
|
// NewQueuePage builds a ZAP-encoded QueuePage message from in and returns the bytes.
|
|
func NewQueuePage(in QueuePageInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(queuePageSize)
|
|
ob.SetText(queuePageProjectOff, in.Project)
|
|
ob.SetText(queuePageQueueIdOff, in.QueueId)
|
|
ob.SetUint32(queuePageLimitOff, in.Limit)
|
|
ob.SetUint32(queuePagePageOff, in.Page)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
objectRefProjectOff = 0
|
|
objectRefObjectIdOff = 8
|
|
objectRefObjectTypeOff = 16
|
|
objectRefSize = 24
|
|
)
|
|
|
|
// ObjectRef is a zero-copy view into a ZAP-encoded ObjectRef message.
|
|
type ObjectRef struct{ o zap.Object }
|
|
|
|
// WrapObjectRef parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapObjectRef(b []byte) (ObjectRef, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ObjectRef{}, err
|
|
}
|
|
return ObjectRef{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ObjectRef) Project() string { return t.o.Text(objectRefProjectOff) }
|
|
func (t ObjectRef) ObjectId() string { return t.o.Text(objectRefObjectIdOff) }
|
|
func (t ObjectRef) ObjectType() string { return t.o.Text(objectRefObjectTypeOff) }
|
|
|
|
// ObjectRefInput collects the field values for NewObjectRef.
|
|
type ObjectRefInput struct {
|
|
Project string
|
|
ObjectId string
|
|
ObjectType string
|
|
}
|
|
|
|
// NewObjectRef builds a ZAP-encoded ObjectRef message from in and returns the bytes.
|
|
func NewObjectRef(in ObjectRefInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(objectRefSize)
|
|
ob.SetText(objectRefProjectOff, in.Project)
|
|
ob.SetText(objectRefObjectIdOff, in.ObjectId)
|
|
ob.SetText(objectRefObjectTypeOff, in.ObjectType)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
queueWriteProjectOff = 0
|
|
queueWriteQueueIdOff = 8
|
|
queueWriteNameOff = 16
|
|
queueWriteDescriptionOff = 24
|
|
queueWriteScoreConfigIdsOff = 32
|
|
queueWriteSize = 40
|
|
)
|
|
|
|
// QueueWrite is a zero-copy view into a ZAP-encoded QueueWrite message.
|
|
type QueueWrite struct{ o zap.Object }
|
|
|
|
// WrapQueueWrite parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapQueueWrite(b []byte) (QueueWrite, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return QueueWrite{}, err
|
|
}
|
|
return QueueWrite{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t QueueWrite) Project() string { return t.o.Text(queueWriteProjectOff) }
|
|
func (t QueueWrite) QueueId() string { return t.o.Text(queueWriteQueueIdOff) }
|
|
func (t QueueWrite) Name() string { return t.o.Text(queueWriteNameOff) }
|
|
func (t QueueWrite) Description() string { return t.o.Text(queueWriteDescriptionOff) }
|
|
func (t QueueWrite) ScoreConfigIds() zap.List { return t.o.List(queueWriteScoreConfigIdsOff) }
|
|
|
|
// QueueWriteInput collects the field values for NewQueueWrite.
|
|
type QueueWriteInput struct {
|
|
Project string
|
|
QueueId string
|
|
Name string
|
|
Description string
|
|
ScoreConfigIds [][]byte
|
|
}
|
|
|
|
// NewQueueWrite builds a ZAP-encoded QueueWrite message from in and returns the bytes.
|
|
func NewQueueWrite(in QueueWriteInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(queueWriteSize)
|
|
ob.SetText(queueWriteProjectOff, in.Project)
|
|
ob.SetText(queueWriteQueueIdOff, in.QueueId)
|
|
ob.SetText(queueWriteNameOff, in.Name)
|
|
ob.SetText(queueWriteDescriptionOff, in.Description)
|
|
scoreConfigIdsLB := b.StartList(0)
|
|
for _, elem := range in.ScoreConfigIds {
|
|
scoreConfigIdsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(queueWriteScoreConfigIdsOff, scoreConfigIdsLB.FinishOffset(), len(in.ScoreConfigIds))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
itemRefProjectOff = 0
|
|
itemRefItemIdOff = 8
|
|
itemRefQueueIdOff = 16
|
|
itemRefSize = 24
|
|
)
|
|
|
|
// ItemRef is a zero-copy view into a ZAP-encoded ItemRef message.
|
|
type ItemRef struct{ o zap.Object }
|
|
|
|
// WrapItemRef parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapItemRef(b []byte) (ItemRef, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ItemRef{}, err
|
|
}
|
|
return ItemRef{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ItemRef) Project() string { return t.o.Text(itemRefProjectOff) }
|
|
func (t ItemRef) ItemId() string { return t.o.Text(itemRefItemIdOff) }
|
|
func (t ItemRef) QueueId() string { return t.o.Text(itemRefQueueIdOff) }
|
|
|
|
// ItemRefInput collects the field values for NewItemRef.
|
|
type ItemRefInput struct {
|
|
Project string
|
|
ItemId string
|
|
QueueId string
|
|
}
|
|
|
|
// NewItemRef builds a ZAP-encoded ItemRef message from in and returns the bytes.
|
|
func NewItemRef(in ItemRefInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(itemRefSize)
|
|
ob.SetText(itemRefProjectOff, in.Project)
|
|
ob.SetText(itemRefItemIdOff, in.ItemId)
|
|
ob.SetText(itemRefQueueIdOff, in.QueueId)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
seenScopeProjectOff = 0
|
|
seenScopeQueueIdOff = 8
|
|
seenScopeSeenItemIdsOff = 16
|
|
seenScopeSize = 24
|
|
)
|
|
|
|
// SeenScope is a zero-copy view into a ZAP-encoded SeenScope message.
|
|
type SeenScope struct{ o zap.Object }
|
|
|
|
// WrapSeenScope parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapSeenScope(b []byte) (SeenScope, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return SeenScope{}, err
|
|
}
|
|
return SeenScope{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t SeenScope) Project() string { return t.o.Text(seenScopeProjectOff) }
|
|
func (t SeenScope) QueueId() string { return t.o.Text(seenScopeQueueIdOff) }
|
|
func (t SeenScope) SeenItemIds() zap.List { return t.o.List(seenScopeSeenItemIdsOff) }
|
|
|
|
// SeenScopeInput collects the field values for NewSeenScope.
|
|
type SeenScopeInput struct {
|
|
Project string
|
|
QueueId string
|
|
SeenItemIds [][]byte
|
|
}
|
|
|
|
// NewSeenScope builds a ZAP-encoded SeenScope message from in and returns the bytes.
|
|
func NewSeenScope(in SeenScopeInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(seenScopeSize)
|
|
ob.SetText(seenScopeProjectOff, in.Project)
|
|
ob.SetText(seenScopeQueueIdOff, in.QueueId)
|
|
seenItemIdsLB := b.StartList(0)
|
|
for _, elem := range in.SeenItemIds {
|
|
seenItemIdsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(seenScopeSeenItemIdsOff, seenItemIdsLB.FinishOffset(), len(in.SeenItemIds))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
itemCreateManyProjectOff = 0
|
|
itemCreateManyQueueIdOff = 8
|
|
itemCreateManyObjectIdsOff = 16
|
|
itemCreateManyObjectTypeOff = 24
|
|
itemCreateManySize = 32
|
|
)
|
|
|
|
// ItemCreateMany is a zero-copy view into a ZAP-encoded ItemCreateMany message.
|
|
type ItemCreateMany struct{ o zap.Object }
|
|
|
|
// WrapItemCreateMany parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapItemCreateMany(b []byte) (ItemCreateMany, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ItemCreateMany{}, err
|
|
}
|
|
return ItemCreateMany{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ItemCreateMany) Project() string { return t.o.Text(itemCreateManyProjectOff) }
|
|
func (t ItemCreateMany) QueueId() string { return t.o.Text(itemCreateManyQueueIdOff) }
|
|
func (t ItemCreateMany) ObjectIds() zap.List { return t.o.List(itemCreateManyObjectIdsOff) }
|
|
func (t ItemCreateMany) ObjectType() string { return t.o.Text(itemCreateManyObjectTypeOff) }
|
|
|
|
// ItemCreateManyInput collects the field values for NewItemCreateMany.
|
|
type ItemCreateManyInput struct {
|
|
Project string
|
|
QueueId string
|
|
ObjectIds [][]byte
|
|
ObjectType string
|
|
}
|
|
|
|
// NewItemCreateMany builds a ZAP-encoded ItemCreateMany message from in and returns the bytes.
|
|
func NewItemCreateMany(in ItemCreateManyInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(itemCreateManySize)
|
|
ob.SetText(itemCreateManyProjectOff, in.Project)
|
|
ob.SetText(itemCreateManyQueueIdOff, in.QueueId)
|
|
objectIdsLB := b.StartList(0)
|
|
for _, elem := range in.ObjectIds {
|
|
objectIdsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(itemCreateManyObjectIdsOff, objectIdsLB.FinishOffset(), len(in.ObjectIds))
|
|
ob.SetText(itemCreateManyObjectTypeOff, in.ObjectType)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
itemIdsProjectOff = 0
|
|
itemIdsItemIdsOff = 8
|
|
itemIdsSize = 16
|
|
)
|
|
|
|
// ItemIds is a zero-copy view into a ZAP-encoded ItemIds message.
|
|
type ItemIds struct{ o zap.Object }
|
|
|
|
// WrapItemIds parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapItemIds(b []byte) (ItemIds, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ItemIds{}, err
|
|
}
|
|
return ItemIds{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ItemIds) Project() string { return t.o.Text(itemIdsProjectOff) }
|
|
func (t ItemIds) ItemIds() zap.List { return t.o.List(itemIdsItemIdsOff) }
|
|
|
|
// ItemIdsInput collects the field values for NewItemIds.
|
|
type ItemIdsInput struct {
|
|
Project string
|
|
ItemIds [][]byte
|
|
}
|
|
|
|
// NewItemIds builds a ZAP-encoded ItemIds message from in and returns the bytes.
|
|
func NewItemIds(in ItemIdsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(itemIdsSize)
|
|
ob.SetText(itemIdsProjectOff, in.Project)
|
|
itemIdsLB := b.StartList(0)
|
|
for _, elem := range in.ItemIds {
|
|
itemIdsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(itemIdsItemIdsOff, itemIdsLB.FinishOffset(), len(in.ItemIds))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
assignWriteProjectOff = 0
|
|
assignWriteQueueIdOff = 8
|
|
assignWriteUserIdsOff = 16
|
|
assignWriteSize = 24
|
|
)
|
|
|
|
// AssignWrite is a zero-copy view into a ZAP-encoded AssignWrite message.
|
|
type AssignWrite struct{ o zap.Object }
|
|
|
|
// WrapAssignWrite parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapAssignWrite(b []byte) (AssignWrite, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return AssignWrite{}, err
|
|
}
|
|
return AssignWrite{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t AssignWrite) Project() string { return t.o.Text(assignWriteProjectOff) }
|
|
func (t AssignWrite) QueueId() string { return t.o.Text(assignWriteQueueIdOff) }
|
|
func (t AssignWrite) UserIds() zap.List { return t.o.List(assignWriteUserIdsOff) }
|
|
|
|
// AssignWriteInput collects the field values for NewAssignWrite.
|
|
type AssignWriteInput struct {
|
|
Project string
|
|
QueueId string
|
|
UserIds [][]byte
|
|
}
|
|
|
|
// NewAssignWrite builds a ZAP-encoded AssignWrite message from in and returns the bytes.
|
|
func NewAssignWrite(in AssignWriteInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(assignWriteSize)
|
|
ob.SetText(assignWriteProjectOff, in.Project)
|
|
ob.SetText(assignWriteQueueIdOff, in.QueueId)
|
|
userIdsLB := b.StartList(0)
|
|
for _, elem := range in.UserIds {
|
|
userIdsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(assignWriteUserIdsOff, userIdsLB.FinishOffset(), len(in.UserIds))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
assignOneProjectOff = 0
|
|
assignOneQueueIdOff = 8
|
|
assignOneUserIdOff = 16
|
|
assignOneSize = 24
|
|
)
|
|
|
|
// AssignOne is a zero-copy view into a ZAP-encoded AssignOne message.
|
|
type AssignOne struct{ o zap.Object }
|
|
|
|
// WrapAssignOne parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapAssignOne(b []byte) (AssignOne, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return AssignOne{}, err
|
|
}
|
|
return AssignOne{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t AssignOne) Project() string { return t.o.Text(assignOneProjectOff) }
|
|
func (t AssignOne) QueueId() string { return t.o.Text(assignOneQueueIdOff) }
|
|
func (t AssignOne) UserId() string { return t.o.Text(assignOneUserIdOff) }
|
|
|
|
// AssignOneInput collects the field values for NewAssignOne.
|
|
type AssignOneInput struct {
|
|
Project string
|
|
QueueId string
|
|
UserId string
|
|
}
|
|
|
|
// NewAssignOne builds a ZAP-encoded AssignOne message from in and returns the bytes.
|
|
func NewAssignOne(in AssignOneInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(assignOneSize)
|
|
ob.SetText(assignOneProjectOff, in.Project)
|
|
ob.SetText(assignOneQueueIdOff, in.QueueId)
|
|
ob.SetText(assignOneUserIdOff, in.UserId)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
queueListQueuesOff = 0
|
|
queueListTotalCountOff = 8
|
|
queueListSize = 16
|
|
)
|
|
|
|
// QueueList is a zero-copy view into a ZAP-encoded QueueList message.
|
|
type QueueList struct{ o zap.Object }
|
|
|
|
// WrapQueueList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapQueueList(b []byte) (QueueList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return QueueList{}, err
|
|
}
|
|
return QueueList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t QueueList) Queues() zap.List { return t.o.List(queueListQueuesOff) }
|
|
func (t QueueList) TotalCount() uint64 { return t.o.Uint64(queueListTotalCountOff) }
|
|
|
|
// QueueListInput collects the field values for NewQueueList.
|
|
type QueueListInput struct {
|
|
Queues [][]byte
|
|
TotalCount uint64
|
|
}
|
|
|
|
// NewQueueList builds a ZAP-encoded QueueList message from in and returns the bytes.
|
|
func NewQueueList(in QueueListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(queueListSize)
|
|
queuesLB := b.StartList(0)
|
|
for _, elem := range in.Queues {
|
|
queuesLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(queueListQueuesOff, queuesLB.FinishOffset(), len(in.Queues))
|
|
ob.SetUint64(queueListTotalCountOff, in.TotalCount)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
queueRefListRefsOff = 0
|
|
queueRefListSize = 8
|
|
)
|
|
|
|
// QueueRefList is a zero-copy view into a ZAP-encoded QueueRefList message.
|
|
type QueueRefList struct{ o zap.Object }
|
|
|
|
// WrapQueueRefList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapQueueRefList(b []byte) (QueueRefList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return QueueRefList{}, err
|
|
}
|
|
return QueueRefList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t QueueRefList) Refs() zap.List { return t.o.List(queueRefListRefsOff) }
|
|
|
|
// QueueRefListInput collects the field values for NewQueueRefList.
|
|
type QueueRefListInput struct {
|
|
Refs [][]byte
|
|
}
|
|
|
|
// NewQueueRefList builds a ZAP-encoded QueueRefList message from in and returns the bytes.
|
|
func NewQueueRefList(in QueueRefListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(queueRefListSize)
|
|
refsLB := b.StartList(0)
|
|
for _, elem := range in.Refs {
|
|
refsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(queueRefListRefsOff, refsLB.FinishOffset(), len(in.Refs))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
queueObjectListHitsOff = 0
|
|
queueObjectListTotalCountOff = 8
|
|
queueObjectListSize = 16
|
|
)
|
|
|
|
// QueueObjectList is a zero-copy view into a ZAP-encoded QueueObjectList message.
|
|
type QueueObjectList struct{ o zap.Object }
|
|
|
|
// WrapQueueObjectList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapQueueObjectList(b []byte) (QueueObjectList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return QueueObjectList{}, err
|
|
}
|
|
return QueueObjectList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t QueueObjectList) Hits() zap.List { return t.o.List(queueObjectListHitsOff) }
|
|
func (t QueueObjectList) TotalCount() uint64 { return t.o.Uint64(queueObjectListTotalCountOff) }
|
|
|
|
// QueueObjectListInput collects the field values for NewQueueObjectList.
|
|
type QueueObjectListInput struct {
|
|
Hits [][]byte
|
|
TotalCount uint64
|
|
}
|
|
|
|
// NewQueueObjectList builds a ZAP-encoded QueueObjectList message from in and returns the bytes.
|
|
func NewQueueObjectList(in QueueObjectListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(queueObjectListSize)
|
|
hitsLB := b.StartList(0)
|
|
for _, elem := range in.Hits {
|
|
hitsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(queueObjectListHitsOff, hitsLB.FinishOffset(), len(in.Hits))
|
|
ob.SetUint64(queueObjectListTotalCountOff, in.TotalCount)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
queueItemListItemsOff = 0
|
|
queueItemListTotalCountOff = 8
|
|
queueItemListSize = 16
|
|
)
|
|
|
|
// QueueItemList is a zero-copy view into a ZAP-encoded QueueItemList message.
|
|
type QueueItemList struct{ o zap.Object }
|
|
|
|
// WrapQueueItemList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapQueueItemList(b []byte) (QueueItemList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return QueueItemList{}, err
|
|
}
|
|
return QueueItemList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t QueueItemList) Items() zap.List { return t.o.List(queueItemListItemsOff) }
|
|
func (t QueueItemList) TotalCount() uint64 { return t.o.Uint64(queueItemListTotalCountOff) }
|
|
|
|
// QueueItemListInput collects the field values for NewQueueItemList.
|
|
type QueueItemListInput struct {
|
|
Items [][]byte
|
|
TotalCount uint64
|
|
}
|
|
|
|
// NewQueueItemList builds a ZAP-encoded QueueItemList message from in and returns the bytes.
|
|
func NewQueueItemList(in QueueItemListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(queueItemListSize)
|
|
itemsLB := b.StartList(0)
|
|
for _, elem := range in.Items {
|
|
itemsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(queueItemListItemsOff, itemsLB.FinishOffset(), len(in.Items))
|
|
ob.SetUint64(queueItemListTotalCountOff, in.TotalCount)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
assignListAssignmentsOff = 0
|
|
assignListTotalCountOff = 8
|
|
assignListSize = 16
|
|
)
|
|
|
|
// AssignList is a zero-copy view into a ZAP-encoded AssignList message.
|
|
type AssignList struct{ o zap.Object }
|
|
|
|
// WrapAssignList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapAssignList(b []byte) (AssignList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return AssignList{}, err
|
|
}
|
|
return AssignList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t AssignList) Assignments() zap.List { return t.o.List(assignListAssignmentsOff) }
|
|
func (t AssignList) TotalCount() uint64 { return t.o.Uint64(assignListTotalCountOff) }
|
|
|
|
// AssignListInput collects the field values for NewAssignList.
|
|
type AssignListInput struct {
|
|
Assignments [][]byte
|
|
TotalCount uint64
|
|
}
|
|
|
|
// NewAssignList builds a ZAP-encoded AssignList message from in and returns the bytes.
|
|
func NewAssignList(in AssignListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(assignListSize)
|
|
assignmentsLB := b.StartList(0)
|
|
for _, elem := range in.Assignments {
|
|
assignmentsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(assignListAssignmentsOff, assignmentsLB.FinishOffset(), len(in.Assignments))
|
|
ob.SetUint64(assignListTotalCountOff, in.TotalCount)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
createManyResultCreatedCountOff = 0
|
|
createManyResultQueueNameOff = 8
|
|
createManyResultQueueIdOff = 16
|
|
createManyResultSize = 24
|
|
)
|
|
|
|
// CreateManyResult is a zero-copy view into a ZAP-encoded CreateManyResult message.
|
|
type CreateManyResult struct{ o zap.Object }
|
|
|
|
// WrapCreateManyResult parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapCreateManyResult(b []byte) (CreateManyResult, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return CreateManyResult{}, err
|
|
}
|
|
return CreateManyResult{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t CreateManyResult) CreatedCount() uint64 { return t.o.Uint64(createManyResultCreatedCountOff) }
|
|
func (t CreateManyResult) QueueName() string { return t.o.Text(createManyResultQueueNameOff) }
|
|
func (t CreateManyResult) QueueId() string { return t.o.Text(createManyResultQueueIdOff) }
|
|
|
|
// CreateManyResultInput collects the field values for NewCreateManyResult.
|
|
type CreateManyResultInput struct {
|
|
CreatedCount uint64
|
|
QueueName string
|
|
QueueId string
|
|
}
|
|
|
|
// NewCreateManyResult builds a ZAP-encoded CreateManyResult message from in and returns the bytes.
|
|
func NewCreateManyResult(in CreateManyResultInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(createManyResultSize)
|
|
ob.SetUint64(createManyResultCreatedCountOff, in.CreatedCount)
|
|
ob.SetText(createManyResultQueueNameOff, in.QueueName)
|
|
ob.SetText(createManyResultQueueIdOff, in.QueueId)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
assignResultSuccessOff = 0
|
|
assignResultAddedCountOff = 8
|
|
assignResultSkippedCountOff = 16
|
|
assignResultSize = 24
|
|
)
|
|
|
|
// AssignResult is a zero-copy view into a ZAP-encoded AssignResult message.
|
|
type AssignResult struct{ o zap.Object }
|
|
|
|
// WrapAssignResult parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapAssignResult(b []byte) (AssignResult, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return AssignResult{}, err
|
|
}
|
|
return AssignResult{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t AssignResult) Success() bool { return t.o.Bool(assignResultSuccessOff) }
|
|
func (t AssignResult) AddedCount() uint64 { return t.o.Uint64(assignResultAddedCountOff) }
|
|
func (t AssignResult) SkippedCount() uint64 { return t.o.Uint64(assignResultSkippedCountOff) }
|
|
|
|
// AssignResultInput collects the field values for NewAssignResult.
|
|
type AssignResultInput struct {
|
|
Success bool
|
|
AddedCount uint64
|
|
SkippedCount uint64
|
|
}
|
|
|
|
// NewAssignResult builds a ZAP-encoded AssignResult message from in and returns the bytes.
|
|
func NewAssignResult(in AssignResultInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(assignResultSize)
|
|
ob.SetBool(assignResultSuccessOff, in.Success)
|
|
ob.SetUint64(assignResultAddedCountOff, in.AddedCount)
|
|
ob.SetUint64(assignResultSkippedCountOff, in.SkippedCount)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
boolResultValueOff = 0
|
|
boolResultSize = 1
|
|
)
|
|
|
|
// BoolResult is a zero-copy view into a ZAP-encoded BoolResult message.
|
|
type BoolResult struct{ o zap.Object }
|
|
|
|
// WrapBoolResult parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapBoolResult(b []byte) (BoolResult, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return BoolResult{}, err
|
|
}
|
|
return BoolResult{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t BoolResult) Value() bool { return t.o.Bool(boolResultValueOff) }
|
|
|
|
// BoolResultInput collects the field values for NewBoolResult.
|
|
type BoolResultInput struct {
|
|
Value bool
|
|
}
|
|
|
|
// NewBoolResult builds a ZAP-encoded BoolResult message from in and returns the bytes.
|
|
func NewBoolResult(in BoolResultInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(boolResultSize)
|
|
ob.SetBool(boolResultValueOff, in.Value)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
countResultCountOff = 0
|
|
countResultSize = 8
|
|
)
|
|
|
|
// CountResult is a zero-copy view into a ZAP-encoded CountResult message.
|
|
type CountResult struct{ o zap.Object }
|
|
|
|
// WrapCountResult parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapCountResult(b []byte) (CountResult, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return CountResult{}, err
|
|
}
|
|
return CountResult{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t CountResult) Count() uint64 { return t.o.Uint64(countResultCountOff) }
|
|
|
|
// CountResultInput collects the field values for NewCountResult.
|
|
type CountResultInput struct {
|
|
Count uint64
|
|
}
|
|
|
|
// NewCountResult builds a ZAP-encoded CountResult message from in and returns the bytes.
|
|
func NewCountResult(in CountResultInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(countResultSize)
|
|
ob.SetUint64(countResultCountOff, in.Count)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
textResultValueOff = 0
|
|
textResultSize = 8
|
|
)
|
|
|
|
// TextResult is a zero-copy view into a ZAP-encoded TextResult message.
|
|
type TextResult struct{ o zap.Object }
|
|
|
|
// WrapTextResult parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapTextResult(b []byte) (TextResult, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return TextResult{}, err
|
|
}
|
|
return TextResult{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t TextResult) Value() string { return t.o.Text(textResultValueOff) }
|
|
|
|
// TextResultInput collects the field values for NewTextResult.
|
|
type TextResultInput struct {
|
|
Value string
|
|
}
|
|
|
|
// NewTextResult builds a ZAP-encoded TextResult message from in and returns the bytes.
|
|
func NewTextResult(in TextResultInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(textResultSize)
|
|
ob.SetText(textResultValueOff, in.Value)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|