本文整理匯總了Golang中github.com/willfaught/company/prototype/company/offer.Offer.Interface方法的典型用法代碼示例。如果您正苦於以下問題:Golang Offer.Interface方法的具體用法?Golang Offer.Interface怎麽用?Golang Offer.Interface使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/willfaught/company/prototype/company/offer.Offer
的用法示例。
在下文中一共展示了Offer.Interface方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: New
// New creates m.
func (c Client) New(m offer.Offer) (offer.Offer, error) {
m.Interface = nil
var argument = struct {
Arguments struct {
M offer.Offer
}
Context Context
}{
Arguments: struct {
M offer.Offer
}{
M: m,
},
Context: c.Context,
}
var result struct {
Offer offer.Offer
}
c.Configuration.OnCall("New", argument.Context, argument.Arguments)
var err = c.Client.Call(c.Name+".New", argument, &result)
c.Configuration.OnReturn("New", argument.Context, result, err)
result.Offer.Interface = c
return result.Offer, err
}
示例2: Delete
// Delete deletes m.
func (c Client) Delete(m offer.Offer) (offer.Offer, error) {
m.Interface = nil // Avoid encoding the Service or Client
var argument = struct {
Arguments struct { // Method arguments
M offer.Offer // m
}
Context Context // Call context
}{
Arguments: struct { // Method arguments
M offer.Offer // m
}{
M: m, // m
},
Context: c.Context, // Call context
}
var result struct { // Method result
Offer offer.Offer // Only one non-error result
}
c.Configuration.OnCall("Delete", argument.Context, argument.Arguments) // Called because Configuration implements it
var err = c.Client.Call(c.Name+".Delete", argument, &result)
c.Configuration.OnReturn("Delete", argument.Context, result, err) // Called because Configuration implements it
result.Offer.Interface = c // Enable method calls like m.Delete(). See offer.Offer.Delete.
return result.Offer, err
}
示例3: simplify
func simplify(o offer.Offer) offer.Offer {
o.Interface = nil
return o
}