本文整理匯總了Golang中github.com/apache/thrift/lib/go/thrift.TProtocol.WriteBool方法的典型用法代碼示例。如果您正苦於以下問題:Golang TProtocol.WriteBool方法的具體用法?Golang TProtocol.WriteBool怎麽用?Golang TProtocol.WriteBool使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/apache/thrift/lib/go/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.WriteBool方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: writeField1
func (p *HealthStatus) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("ok", thrift.BOOL, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ok: ", p), err)
}
if err := oprot.WriteBool(bool(p.Ok)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.ok (1) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ok: ", p), err)
}
return err
}
示例2: writeField1
func (p *HealthCheckRes) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("healthy", thrift.BOOL, 1); err != nil {
return fmt.Errorf("%T write field begin error 1:healthy: %s", p, err)
}
if err := oprot.WriteBool(bool(p.Healthy)); err != nil {
return fmt.Errorf("%T.healthy (1) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 1:healthy: %s", p, err)
}
return err
}
示例3: writeField1
func (p *Data) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("b1", thrift.BOOL, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:b1: ", p), err)
}
if err := oprot.WriteBool(bool(p.B1)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.b1 (1) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:b1: ", p), err)
}
return err
}
示例4: writeField1
func (p *Response) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("ok", thrift.BOOL, 1); err != nil {
return fmt.Errorf("%T write field begin error 1:ok: %s", p, err)
}
if err := oprot.WriteBool(bool(p.Ok)); err != nil {
return fmt.Errorf("%T.ok (1) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 1:ok: %s", p, err)
}
return err
}
示例5: writeField9
func (p *Span) writeField9(oprot thrift.TProtocol) (err error) {
if p.IsSetDebug() {
if err := oprot.WriteFieldBegin("debug", thrift.BOOL, 9); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:debug: ", p), err)
}
if err := oprot.WriteBool(bool(p.Debug)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.debug (9) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 9:debug: ", p), err)
}
}
return err
}
示例6: writeField4
func (p *BinaryAnnotation) writeField4(oprot thrift.TProtocol) (err error) {
if p.IsSetBoolValue() {
if err := oprot.WriteFieldBegin("boolValue", thrift.BOOL, 4); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:boolValue: ", p), err)
}
if err := oprot.WriteBool(bool(*p.BoolValue)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.boolValue (4) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 4:boolValue: ", p), err)
}
}
return err
}
示例7: writeField8
func (p *Span) writeField8(oprot thrift.TProtocol) (err error) {
if p.IsSetDebug() {
if err := oprot.WriteFieldBegin("debug", thrift.BOOL, 8); err != nil {
return fmt.Errorf("%T write field begin error 8:debug: %s", p, err)
}
if err := oprot.WriteBool(bool(p.Debug)); err != nil {
return fmt.Errorf("%T.debug (8) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 8:debug: %s", p, err)
}
}
return err
}