M3O SDK Concept

This commit is contained in:
Ben Toogood
2020-11-25 16:06:44 +00:00
parent 7818a050c2
commit 5fa6c1244f
21 changed files with 1293 additions and 524 deletions

27
context/context.go Normal file
View File

@@ -0,0 +1,27 @@
// Package context provides a layer of abstraction above go's native context, providing access to
// metadata which can be set by passing headers to the M3O API.
package context
import "context"
// Context provided to a service handler
type Context struct {
context.Context
}
// GetRequestHeader from the request
func (c *Context) GetRequestHeader(key string) string {
return ""
}
// SetRequestHeader on the context
func (c *Context) SetRequestHeader(key, value string) {
}
// SetResponseHeader on the context
func (c *Context) SetResponseHeader(key, value string) {
}
// SetResponseCode on the context
func (c *Context) SetResponseCode(code int) {
}