1package getter 2 3import "context" 4 5// getter is our base getter; it regroups 6// fields all getters have in common. 7type getter struct { 8 client *Client 9} 10 11func (g *getter) SetClient(c *Client) { g.client = c } 12 13// Context tries to returns the Contex from the getter's 14// client. otherwise context.Background() is returned. 15func (g *getter) Context() context.Context { 16 if g == nil || g.client == nil { 17 return context.Background() 18 } 19 return g.client.Ctx 20} 21