github.com/ronaksoft/rony@v0.16.26-0.20230807065236-1743dbfe6959/internal/testEnv/pb/singleton/singleton.rony.go (about)

     1  // Code generated by Rony's protoc plugin; DO NOT EDIT.
     2  // ProtoC ver. v3.17.3
     3  // Rony ver. v0.16.24
     4  // Source: singleton.proto
     5  
     6  package singleton
     7  
     8  import (
     9  	bytes "bytes"
    10  	edge "github.com/ronaksoft/rony/edge"
    11  	pools "github.com/ronaksoft/rony/pools"
    12  	registry "github.com/ronaksoft/rony/registry"
    13  	protojson "google.golang.org/protobuf/encoding/protojson"
    14  	proto "google.golang.org/protobuf/proto"
    15  	sync "sync"
    16  )
    17  
    18  var _ = pools.Imported
    19  
    20  const C_Single1 uint64 = 4833170411250891328
    21  
    22  type poolSingle1 struct {
    23  	pool sync.Pool
    24  }
    25  
    26  func (p *poolSingle1) Get() *Single1 {
    27  	x, ok := p.pool.Get().(*Single1)
    28  	if !ok {
    29  		x = &Single1{}
    30  	}
    31  
    32  	return x
    33  }
    34  
    35  func (p *poolSingle1) Put(x *Single1) {
    36  	if x == nil {
    37  		return
    38  	}
    39  
    40  	x.ID = 0
    41  	x.ShardKey = 0
    42  	x.P1 = ""
    43  	x.P2 = x.P2[:0]
    44  	x.P5 = 0
    45  	x.Enum = 0
    46  
    47  	p.pool.Put(x)
    48  }
    49  
    50  var PoolSingle1 = poolSingle1{}
    51  
    52  func (x *Single1) DeepCopy(z *Single1) {
    53  	z.ID = x.ID
    54  	z.ShardKey = x.ShardKey
    55  	z.P1 = x.P1
    56  	z.P2 = append(z.P2[:0], x.P2...)
    57  	z.P5 = x.P5
    58  	z.Enum = x.Enum
    59  }
    60  
    61  func (x *Single1) Clone() *Single1 {
    62  	z := &Single1{}
    63  	x.DeepCopy(z)
    64  	return z
    65  }
    66  
    67  func (x *Single1) Unmarshal(b []byte) error {
    68  	return proto.UnmarshalOptions{Merge: true}.Unmarshal(b, x)
    69  }
    70  
    71  func (x *Single1) Marshal() ([]byte, error) {
    72  	return proto.Marshal(x)
    73  }
    74  
    75  func (x *Single1) UnmarshalJSON(b []byte) error {
    76  	return protojson.Unmarshal(b, x)
    77  }
    78  
    79  func (x *Single1) MarshalJSON() ([]byte, error) {
    80  	return protojson.Marshal(x)
    81  }
    82  
    83  func factorySingle1() registry.Message {
    84  	return &Single1{}
    85  }
    86  
    87  func (x *Single1) PushToContext(ctx *edge.RequestCtx) {
    88  	ctx.PushMessage(C_Single1, x)
    89  }
    90  
    91  const C_Single2 uint64 = 4738594819076110912
    92  
    93  type poolSingle2 struct {
    94  	pool sync.Pool
    95  }
    96  
    97  func (p *poolSingle2) Get() *Single2 {
    98  	x, ok := p.pool.Get().(*Single2)
    99  	if !ok {
   100  		x = &Single2{}
   101  	}
   102  
   103  	return x
   104  }
   105  
   106  func (p *poolSingle2) Put(x *Single2) {
   107  	if x == nil {
   108  		return
   109  	}
   110  
   111  	x.ID = 0
   112  	x.ShardKey = 0
   113  	x.P1 = ""
   114  	x.P2 = x.P2[:0]
   115  	x.P5 = 0
   116  
   117  	p.pool.Put(x)
   118  }
   119  
   120  var PoolSingle2 = poolSingle2{}
   121  
   122  func (x *Single2) DeepCopy(z *Single2) {
   123  	z.ID = x.ID
   124  	z.ShardKey = x.ShardKey
   125  	z.P1 = x.P1
   126  	z.P2 = append(z.P2[:0], x.P2...)
   127  	z.P5 = x.P5
   128  }
   129  
   130  func (x *Single2) Clone() *Single2 {
   131  	z := &Single2{}
   132  	x.DeepCopy(z)
   133  	return z
   134  }
   135  
   136  func (x *Single2) Unmarshal(b []byte) error {
   137  	return proto.UnmarshalOptions{Merge: true}.Unmarshal(b, x)
   138  }
   139  
   140  func (x *Single2) Marshal() ([]byte, error) {
   141  	return proto.Marshal(x)
   142  }
   143  
   144  func (x *Single2) UnmarshalJSON(b []byte) error {
   145  	return protojson.Unmarshal(b, x)
   146  }
   147  
   148  func (x *Single2) MarshalJSON() ([]byte, error) {
   149  	return protojson.Marshal(x)
   150  }
   151  
   152  func factorySingle2() registry.Message {
   153  	return &Single2{}
   154  }
   155  
   156  func (x *Single2) PushToContext(ctx *edge.RequestCtx) {
   157  	ctx.PushMessage(C_Single2, x)
   158  }
   159  
   160  // register constructors of the messages to the registry package
   161  func init() {
   162  	registry.Register(4833170411250891328, "Single1", factorySingle1)
   163  	registry.Register(4738594819076110912, "Single2", factorySingle2)
   164  
   165  }
   166  
   167  var _ = bytes.MinRead