diff --git a/Gopkg.lock b/Gopkg.lock index b6294d836..831013a43 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -701,14 +701,14 @@ [[projects]] branch = "master" - digest = "1:11a561b078819a1cd5d9d9c52031e8476e9ee7622f2b3b054850940a7d167971" + digest = "1:98afffae13f349c0963814f73abbe86003bb1f8be44c4829a1e5e782b5aab9b0" name = "github.com/jim-minter/go-cosmosdb" packages = [ "cmd/gencosmosdb", "pkg/gencosmosdb", ] pruneopts = "UT" - revision = "0e3ac7c97cf21cf5fcd6315b6ed273db35b3c531" + revision = "1528d2db09d65eb9a8a1df75f0ba1d5add4bcf44" [[projects]] digest = "1:bb81097a5b62634f3e9fec1014657855610c82d19b9a40c17612e32651e35dca" @@ -2408,9 +2408,11 @@ "sigs.k8s.io/controller-runtime", "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil", "sigs.k8s.io/controller-runtime/pkg/event", + "sigs.k8s.io/controller-runtime/pkg/handler", "sigs.k8s.io/controller-runtime/pkg/predicate", "sigs.k8s.io/controller-runtime/pkg/reconcile", "sigs.k8s.io/controller-runtime/pkg/scheme", + "sigs.k8s.io/controller-runtime/pkg/source", "sigs.k8s.io/controller-tools/cmd/controller-gen", ] solver-name = "gps-cdcl" diff --git a/cgmanifest.json b/cgmanifest.json index 01a516190..9b2ca92d1 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -553,7 +553,7 @@ "component": { "type": "git", "git": { - "commitHash": "0e3ac7c97cf21cf5fcd6315b6ed273db35b3c531", + "commitHash": "1528d2db09d65eb9a8a1df75f0ba1d5add4bcf44", "repositoryUrl": "https://github.com/jim-minter/go-cosmosdb/" } } diff --git a/pkg/database/cosmosdb/zz_generated_asyncoperationdocument.go b/pkg/database/cosmosdb/zz_generated_asyncoperationdocument.go index c36beb4e9..7330a02fc 100644 --- a/pkg/database/cosmosdb/zz_generated_asyncoperationdocument.go +++ b/pkg/database/cosmosdb/zz_generated_asyncoperationdocument.go @@ -19,7 +19,7 @@ type asyncOperationDocumentClient struct { // AsyncOperationDocumentClient is a asyncOperationDocument client type AsyncOperationDocumentClient interface { Create(context.Context, string, *pkg.AsyncOperationDocument, *Options) (*pkg.AsyncOperationDocument, error) - List(*Options) AsyncOperationDocumentRawIterator + List(*Options) AsyncOperationDocumentIterator ListAll(context.Context, *Options) (*pkg.AsyncOperationDocuments, error) Get(context.Context, string, string, *Options) (*pkg.AsyncOperationDocument, error) Replace(context.Context, string, *pkg.AsyncOperationDocument, *Options) (*pkg.AsyncOperationDocument, error) @@ -109,7 +109,7 @@ func (c *asyncOperationDocumentClient) Create(ctx context.Context, partitionkey return } -func (c *asyncOperationDocumentClient) List(options *Options) AsyncOperationDocumentRawIterator { +func (c *asyncOperationDocumentClient) List(options *Options) AsyncOperationDocumentIterator { continuation := "" if options != nil { continuation = options.Continuation @@ -239,11 +239,6 @@ func (i *asyncOperationDocumentChangeFeedIterator) Continuation() string { } func (i *asyncOperationDocumentListIterator) Next(ctx context.Context, maxItemCount int) (asyncOperationDocuments *pkg.AsyncOperationDocuments, err error) { - err = i.NextRaw(ctx, maxItemCount, &asyncOperationDocuments) - return -} - -func (i *asyncOperationDocumentListIterator) NextRaw(ctx context.Context, maxItemCount int, raw interface{}) (err error) { if i.done { return } @@ -259,7 +254,7 @@ func (i *asyncOperationDocumentListIterator) NextRaw(ctx context.Context, maxIte return } - err = i.do(ctx, http.MethodGet, i.path+"/docs", "docs", i.path, http.StatusOK, nil, &raw, headers) + err = i.do(ctx, http.MethodGet, i.path+"/docs", "docs", i.path, http.StatusOK, nil, &asyncOperationDocuments, headers) if err != nil { return } diff --git a/pkg/database/cosmosdb/zz_generated_asyncoperationdocument_fake.go b/pkg/database/cosmosdb/zz_generated_asyncoperationdocument_fake.go new file mode 100644 index 000000000..bd2a0e564 --- /dev/null +++ b/pkg/database/cosmosdb/zz_generated_asyncoperationdocument_fake.go @@ -0,0 +1,360 @@ +// Code generated by github.com/jim-minter/go-cosmosdb, DO NOT EDIT. + +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + "sync" + + "github.com/ugorji/go/codec" + + pkg "github.com/Azure/ARO-RP/pkg/api" +) + +type fakeAsyncOperationDocumentTriggerHandler func(context.Context, *pkg.AsyncOperationDocument) error +type fakeAsyncOperationDocumentQueryHandler func(AsyncOperationDocumentClient, *Query, *Options) AsyncOperationDocumentRawIterator + +var _ AsyncOperationDocumentClient = &FakeAsyncOperationDocumentClient{} + +// NewFakeAsyncOperationDocumentClient returns a FakeAsyncOperationDocumentClient +func NewFakeAsyncOperationDocumentClient(h *codec.JsonHandle) *FakeAsyncOperationDocumentClient { + return &FakeAsyncOperationDocumentClient{ + asyncOperationDocuments: make(map[string][]byte), + triggerHandlers: make(map[string]fakeAsyncOperationDocumentTriggerHandler), + queryHandlers: make(map[string]fakeAsyncOperationDocumentQueryHandler), + jsonHandle: h, + lock: &sync.RWMutex{}, + } +} + +// FakeAsyncOperationDocumentClient is a FakeAsyncOperationDocumentClient +type FakeAsyncOperationDocumentClient struct { + asyncOperationDocuments map[string][]byte + jsonHandle *codec.JsonHandle + lock *sync.RWMutex + triggerHandlers map[string]fakeAsyncOperationDocumentTriggerHandler + queryHandlers map[string]fakeAsyncOperationDocumentQueryHandler + sorter func([]*pkg.AsyncOperationDocument) + + // returns true if documents conflict + conflictChecker func(*pkg.AsyncOperationDocument, *pkg.AsyncOperationDocument) bool + + // err, if not nil, is an error to return when attempting to communicate + // with this Client + err error +} + +func (c *FakeAsyncOperationDocumentClient) decodeAsyncOperationDocument(s []byte) (asyncOperationDocument *pkg.AsyncOperationDocument, err error) { + err = codec.NewDecoderBytes(s, c.jsonHandle).Decode(&asyncOperationDocument) + return +} + +func (c *FakeAsyncOperationDocumentClient) encodeAsyncOperationDocument(asyncOperationDocument *pkg.AsyncOperationDocument) (b []byte, err error) { + err = codec.NewEncoderBytes(&b, c.jsonHandle).Encode(asyncOperationDocument) + return +} + +// SetError sets or unsets an error that will be returned on any +// FakeAsyncOperationDocumentClient method invocation +func (c *FakeAsyncOperationDocumentClient) SetError(err error) { + c.lock.Lock() + defer c.lock.Unlock() + + c.err = err +} + +// SetSorter sets or unsets a sorter function which will be used to sort values +// returned by List() for test stability +func (c *FakeAsyncOperationDocumentClient) SetSorter(sorter func([]*pkg.AsyncOperationDocument)) { + c.lock.Lock() + defer c.lock.Unlock() + + c.sorter = sorter +} + +// SetConflictChecker sets or unsets a function which can be used to validate +// additional unique keys in a AsyncOperationDocument +func (c *FakeAsyncOperationDocumentClient) SetConflictChecker(conflictChecker func(*pkg.AsyncOperationDocument, *pkg.AsyncOperationDocument) bool) { + c.lock.Lock() + defer c.lock.Unlock() + + c.conflictChecker = conflictChecker +} + +// SetTriggerHandler sets or unsets a trigger handler +func (c *FakeAsyncOperationDocumentClient) SetTriggerHandler(triggerName string, trigger fakeAsyncOperationDocumentTriggerHandler) { + c.lock.Lock() + defer c.lock.Unlock() + + c.triggerHandlers[triggerName] = trigger +} + +// SetQueryHandler sets or unsets a query handler +func (c *FakeAsyncOperationDocumentClient) SetQueryHandler(queryName string, query fakeAsyncOperationDocumentQueryHandler) { + c.lock.Lock() + defer c.lock.Unlock() + + c.queryHandlers[queryName] = query +} + +func (c *FakeAsyncOperationDocumentClient) deepCopy(asyncOperationDocument *pkg.AsyncOperationDocument) (*pkg.AsyncOperationDocument, error) { + b, err := c.encodeAsyncOperationDocument(asyncOperationDocument) + if err != nil { + return nil, err + } + + return c.decodeAsyncOperationDocument(b) +} + +func (c *FakeAsyncOperationDocumentClient) apply(ctx context.Context, partitionkey string, asyncOperationDocument *pkg.AsyncOperationDocument, options *Options, isCreate bool) (*pkg.AsyncOperationDocument, error) { + c.lock.Lock() + defer c.lock.Unlock() + + if c.err != nil { + return nil, c.err + } + + asyncOperationDocument, err := c.deepCopy(asyncOperationDocument) // copy now because pretriggers can mutate asyncOperationDocument + if err != nil { + return nil, err + } + + if options != nil { + err := c.processPreTriggers(ctx, asyncOperationDocument, options) + if err != nil { + return nil, err + } + } + + _, exists := c.asyncOperationDocuments[asyncOperationDocument.ID] + if isCreate && exists { + return nil, &Error{ + StatusCode: http.StatusConflict, + Message: "Entity with the specified id already exists in the system", + } + } + if !isCreate && !exists { + return nil, &Error{StatusCode: http.StatusNotFound} + } + + if c.conflictChecker != nil { + for id := range c.asyncOperationDocuments { + asyncOperationDocumentToCheck, err := c.decodeAsyncOperationDocument(c.asyncOperationDocuments[id]) + if err != nil { + return nil, err + } + + if c.conflictChecker(asyncOperationDocumentToCheck, asyncOperationDocument) { + return nil, &Error{ + StatusCode: http.StatusConflict, + Message: "Entity with the specified id already exists in the system", + } + } + } + } + + b, err := c.encodeAsyncOperationDocument(asyncOperationDocument) + if err != nil { + return nil, err + } + + c.asyncOperationDocuments[asyncOperationDocument.ID] = b + + return asyncOperationDocument, nil +} + +// Create creates a AsyncOperationDocument in the database +func (c *FakeAsyncOperationDocumentClient) Create(ctx context.Context, partitionkey string, asyncOperationDocument *pkg.AsyncOperationDocument, options *Options) (*pkg.AsyncOperationDocument, error) { + return c.apply(ctx, partitionkey, asyncOperationDocument, options, true) +} + +// Replace replaces a AsyncOperationDocument in the database +func (c *FakeAsyncOperationDocumentClient) Replace(ctx context.Context, partitionkey string, asyncOperationDocument *pkg.AsyncOperationDocument, options *Options) (*pkg.AsyncOperationDocument, error) { + return c.apply(ctx, partitionkey, asyncOperationDocument, options, false) +} + +// List returns a AsyncOperationDocumentIterator to list all AsyncOperationDocuments in the database +func (c *FakeAsyncOperationDocumentClient) List(*Options) AsyncOperationDocumentIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeAsyncOperationDocumentErroringRawIterator(c.err) + } + + asyncOperationDocuments := make([]*pkg.AsyncOperationDocument, 0, len(c.asyncOperationDocuments)) + for _, d := range c.asyncOperationDocuments { + r, err := c.decodeAsyncOperationDocument(d) + if err != nil { + return NewFakeAsyncOperationDocumentErroringRawIterator(err) + } + asyncOperationDocuments = append(asyncOperationDocuments, r) + } + + if c.sorter != nil { + c.sorter(asyncOperationDocuments) + } + + return NewFakeAsyncOperationDocumentIterator(asyncOperationDocuments, 0) +} + +// ListAll lists all AsyncOperationDocuments in the database +func (c *FakeAsyncOperationDocumentClient) ListAll(ctx context.Context, options *Options) (*pkg.AsyncOperationDocuments, error) { + iter := c.List(options) + return iter.Next(ctx, -1) +} + +// Get gets a AsyncOperationDocument from the database +func (c *FakeAsyncOperationDocumentClient) Get(ctx context.Context, partitionkey string, id string, options *Options) (*pkg.AsyncOperationDocument, error) { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return nil, c.err + } + + asyncOperationDocument, exists := c.asyncOperationDocuments[id] + if !exists { + return nil, &Error{StatusCode: http.StatusNotFound} + } + + return c.decodeAsyncOperationDocument(asyncOperationDocument) +} + +// Delete deletes a AsyncOperationDocument from the database +func (c *FakeAsyncOperationDocumentClient) Delete(ctx context.Context, partitionKey string, asyncOperationDocument *pkg.AsyncOperationDocument, options *Options) error { + c.lock.Lock() + defer c.lock.Unlock() + + if c.err != nil { + return c.err + } + + _, exists := c.asyncOperationDocuments[asyncOperationDocument.ID] + if !exists { + return &Error{StatusCode: http.StatusNotFound} + } + + delete(c.asyncOperationDocuments, asyncOperationDocument.ID) + return nil +} + +// ChangeFeed is unimplemented +func (c *FakeAsyncOperationDocumentClient) ChangeFeed(*Options) AsyncOperationDocumentIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeAsyncOperationDocumentErroringRawIterator(c.err) + } + + return NewFakeAsyncOperationDocumentErroringRawIterator(ErrNotImplemented) +} + +func (c *FakeAsyncOperationDocumentClient) processPreTriggers(ctx context.Context, asyncOperationDocument *pkg.AsyncOperationDocument, options *Options) error { + for _, triggerName := range options.PreTriggers { + if triggerHandler := c.triggerHandlers[triggerName]; triggerHandler != nil { + err := triggerHandler(ctx, asyncOperationDocument) + if err != nil { + return err + } + } else { + return ErrNotImplemented + } + } + + return nil +} + +// Query calls a query handler to implement database querying +func (c *FakeAsyncOperationDocumentClient) Query(name string, query *Query, options *Options) AsyncOperationDocumentRawIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeAsyncOperationDocumentErroringRawIterator(c.err) + } + + if queryHandler := c.queryHandlers[query.Query]; queryHandler != nil { + return queryHandler(c, query, options) + } + + return NewFakeAsyncOperationDocumentErroringRawIterator(ErrNotImplemented) +} + +// QueryAll calls a query handler to implement database querying +func (c *FakeAsyncOperationDocumentClient) QueryAll(ctx context.Context, partitionkey string, query *Query, options *Options) (*pkg.AsyncOperationDocuments, error) { + iter := c.Query("", query, options) + return iter.Next(ctx, -1) +} + +func NewFakeAsyncOperationDocumentIterator(asyncOperationDocuments []*pkg.AsyncOperationDocument, continuation int) AsyncOperationDocumentRawIterator { + return &fakeAsyncOperationDocumentIterator{asyncOperationDocuments: asyncOperationDocuments, continuation: continuation} +} + +type fakeAsyncOperationDocumentIterator struct { + asyncOperationDocuments []*pkg.AsyncOperationDocument + continuation int + done bool +} + +func (i *fakeAsyncOperationDocumentIterator) NextRaw(ctx context.Context, maxItemCount int, out interface{}) error { + return ErrNotImplemented +} + +func (i *fakeAsyncOperationDocumentIterator) Next(ctx context.Context, maxItemCount int) (*pkg.AsyncOperationDocuments, error) { + if i.done { + return nil, nil + } + + var asyncOperationDocuments []*pkg.AsyncOperationDocument + if maxItemCount == -1 { + asyncOperationDocuments = i.asyncOperationDocuments[i.continuation:] + i.continuation = len(i.asyncOperationDocuments) + i.done = true + } else { + max := i.continuation + maxItemCount + if max > len(i.asyncOperationDocuments) { + max = len(i.asyncOperationDocuments) + } + asyncOperationDocuments = i.asyncOperationDocuments[i.continuation:max] + i.continuation += max + i.done = i.Continuation() == "" + } + + return &pkg.AsyncOperationDocuments{ + AsyncOperationDocuments: asyncOperationDocuments, + Count: len(asyncOperationDocuments), + }, nil +} + +func (i *fakeAsyncOperationDocumentIterator) Continuation() string { + if i.continuation >= len(i.asyncOperationDocuments) { + return "" + } + return fmt.Sprintf("%d", i.continuation) +} + +// NewFakeAsyncOperationDocumentErroringRawIterator returns a AsyncOperationDocumentRawIterator which +// whose methods return the given error +func NewFakeAsyncOperationDocumentErroringRawIterator(err error) AsyncOperationDocumentRawIterator { + return &fakeAsyncOperationDocumentErroringRawIterator{err: err} +} + +type fakeAsyncOperationDocumentErroringRawIterator struct { + err error +} + +func (i *fakeAsyncOperationDocumentErroringRawIterator) Next(ctx context.Context, maxItemCount int) (*pkg.AsyncOperationDocuments, error) { + return nil, i.err +} + +func (i *fakeAsyncOperationDocumentErroringRawIterator) NextRaw(context.Context, int, interface{}) error { + return i.err +} + +func (i *fakeAsyncOperationDocumentErroringRawIterator) Continuation() string { + return "" +} diff --git a/pkg/database/cosmosdb/zz_generated_billingdocument.go b/pkg/database/cosmosdb/zz_generated_billingdocument.go index 6ebcc13db..b4a4302cf 100644 --- a/pkg/database/cosmosdb/zz_generated_billingdocument.go +++ b/pkg/database/cosmosdb/zz_generated_billingdocument.go @@ -19,7 +19,7 @@ type billingDocumentClient struct { // BillingDocumentClient is a billingDocument client type BillingDocumentClient interface { Create(context.Context, string, *pkg.BillingDocument, *Options) (*pkg.BillingDocument, error) - List(*Options) BillingDocumentRawIterator + List(*Options) BillingDocumentIterator ListAll(context.Context, *Options) (*pkg.BillingDocuments, error) Get(context.Context, string, string, *Options) (*pkg.BillingDocument, error) Replace(context.Context, string, *pkg.BillingDocument, *Options) (*pkg.BillingDocument, error) @@ -109,7 +109,7 @@ func (c *billingDocumentClient) Create(ctx context.Context, partitionkey string, return } -func (c *billingDocumentClient) List(options *Options) BillingDocumentRawIterator { +func (c *billingDocumentClient) List(options *Options) BillingDocumentIterator { continuation := "" if options != nil { continuation = options.Continuation @@ -239,11 +239,6 @@ func (i *billingDocumentChangeFeedIterator) Continuation() string { } func (i *billingDocumentListIterator) Next(ctx context.Context, maxItemCount int) (billingDocuments *pkg.BillingDocuments, err error) { - err = i.NextRaw(ctx, maxItemCount, &billingDocuments) - return -} - -func (i *billingDocumentListIterator) NextRaw(ctx context.Context, maxItemCount int, raw interface{}) (err error) { if i.done { return } @@ -259,7 +254,7 @@ func (i *billingDocumentListIterator) NextRaw(ctx context.Context, maxItemCount return } - err = i.do(ctx, http.MethodGet, i.path+"/docs", "docs", i.path, http.StatusOK, nil, &raw, headers) + err = i.do(ctx, http.MethodGet, i.path+"/docs", "docs", i.path, http.StatusOK, nil, &billingDocuments, headers) if err != nil { return } diff --git a/pkg/database/cosmosdb/zz_generated_billingdocument_fake.go b/pkg/database/cosmosdb/zz_generated_billingdocument_fake.go new file mode 100644 index 000000000..ce9cb98d2 --- /dev/null +++ b/pkg/database/cosmosdb/zz_generated_billingdocument_fake.go @@ -0,0 +1,360 @@ +// Code generated by github.com/jim-minter/go-cosmosdb, DO NOT EDIT. + +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + "sync" + + "github.com/ugorji/go/codec" + + pkg "github.com/Azure/ARO-RP/pkg/api" +) + +type fakeBillingDocumentTriggerHandler func(context.Context, *pkg.BillingDocument) error +type fakeBillingDocumentQueryHandler func(BillingDocumentClient, *Query, *Options) BillingDocumentRawIterator + +var _ BillingDocumentClient = &FakeBillingDocumentClient{} + +// NewFakeBillingDocumentClient returns a FakeBillingDocumentClient +func NewFakeBillingDocumentClient(h *codec.JsonHandle) *FakeBillingDocumentClient { + return &FakeBillingDocumentClient{ + billingDocuments: make(map[string][]byte), + triggerHandlers: make(map[string]fakeBillingDocumentTriggerHandler), + queryHandlers: make(map[string]fakeBillingDocumentQueryHandler), + jsonHandle: h, + lock: &sync.RWMutex{}, + } +} + +// FakeBillingDocumentClient is a FakeBillingDocumentClient +type FakeBillingDocumentClient struct { + billingDocuments map[string][]byte + jsonHandle *codec.JsonHandle + lock *sync.RWMutex + triggerHandlers map[string]fakeBillingDocumentTriggerHandler + queryHandlers map[string]fakeBillingDocumentQueryHandler + sorter func([]*pkg.BillingDocument) + + // returns true if documents conflict + conflictChecker func(*pkg.BillingDocument, *pkg.BillingDocument) bool + + // err, if not nil, is an error to return when attempting to communicate + // with this Client + err error +} + +func (c *FakeBillingDocumentClient) decodeBillingDocument(s []byte) (billingDocument *pkg.BillingDocument, err error) { + err = codec.NewDecoderBytes(s, c.jsonHandle).Decode(&billingDocument) + return +} + +func (c *FakeBillingDocumentClient) encodeBillingDocument(billingDocument *pkg.BillingDocument) (b []byte, err error) { + err = codec.NewEncoderBytes(&b, c.jsonHandle).Encode(billingDocument) + return +} + +// SetError sets or unsets an error that will be returned on any +// FakeBillingDocumentClient method invocation +func (c *FakeBillingDocumentClient) SetError(err error) { + c.lock.Lock() + defer c.lock.Unlock() + + c.err = err +} + +// SetSorter sets or unsets a sorter function which will be used to sort values +// returned by List() for test stability +func (c *FakeBillingDocumentClient) SetSorter(sorter func([]*pkg.BillingDocument)) { + c.lock.Lock() + defer c.lock.Unlock() + + c.sorter = sorter +} + +// SetConflictChecker sets or unsets a function which can be used to validate +// additional unique keys in a BillingDocument +func (c *FakeBillingDocumentClient) SetConflictChecker(conflictChecker func(*pkg.BillingDocument, *pkg.BillingDocument) bool) { + c.lock.Lock() + defer c.lock.Unlock() + + c.conflictChecker = conflictChecker +} + +// SetTriggerHandler sets or unsets a trigger handler +func (c *FakeBillingDocumentClient) SetTriggerHandler(triggerName string, trigger fakeBillingDocumentTriggerHandler) { + c.lock.Lock() + defer c.lock.Unlock() + + c.triggerHandlers[triggerName] = trigger +} + +// SetQueryHandler sets or unsets a query handler +func (c *FakeBillingDocumentClient) SetQueryHandler(queryName string, query fakeBillingDocumentQueryHandler) { + c.lock.Lock() + defer c.lock.Unlock() + + c.queryHandlers[queryName] = query +} + +func (c *FakeBillingDocumentClient) deepCopy(billingDocument *pkg.BillingDocument) (*pkg.BillingDocument, error) { + b, err := c.encodeBillingDocument(billingDocument) + if err != nil { + return nil, err + } + + return c.decodeBillingDocument(b) +} + +func (c *FakeBillingDocumentClient) apply(ctx context.Context, partitionkey string, billingDocument *pkg.BillingDocument, options *Options, isCreate bool) (*pkg.BillingDocument, error) { + c.lock.Lock() + defer c.lock.Unlock() + + if c.err != nil { + return nil, c.err + } + + billingDocument, err := c.deepCopy(billingDocument) // copy now because pretriggers can mutate billingDocument + if err != nil { + return nil, err + } + + if options != nil { + err := c.processPreTriggers(ctx, billingDocument, options) + if err != nil { + return nil, err + } + } + + _, exists := c.billingDocuments[billingDocument.ID] + if isCreate && exists { + return nil, &Error{ + StatusCode: http.StatusConflict, + Message: "Entity with the specified id already exists in the system", + } + } + if !isCreate && !exists { + return nil, &Error{StatusCode: http.StatusNotFound} + } + + if c.conflictChecker != nil { + for id := range c.billingDocuments { + billingDocumentToCheck, err := c.decodeBillingDocument(c.billingDocuments[id]) + if err != nil { + return nil, err + } + + if c.conflictChecker(billingDocumentToCheck, billingDocument) { + return nil, &Error{ + StatusCode: http.StatusConflict, + Message: "Entity with the specified id already exists in the system", + } + } + } + } + + b, err := c.encodeBillingDocument(billingDocument) + if err != nil { + return nil, err + } + + c.billingDocuments[billingDocument.ID] = b + + return billingDocument, nil +} + +// Create creates a BillingDocument in the database +func (c *FakeBillingDocumentClient) Create(ctx context.Context, partitionkey string, billingDocument *pkg.BillingDocument, options *Options) (*pkg.BillingDocument, error) { + return c.apply(ctx, partitionkey, billingDocument, options, true) +} + +// Replace replaces a BillingDocument in the database +func (c *FakeBillingDocumentClient) Replace(ctx context.Context, partitionkey string, billingDocument *pkg.BillingDocument, options *Options) (*pkg.BillingDocument, error) { + return c.apply(ctx, partitionkey, billingDocument, options, false) +} + +// List returns a BillingDocumentIterator to list all BillingDocuments in the database +func (c *FakeBillingDocumentClient) List(*Options) BillingDocumentIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeBillingDocumentErroringRawIterator(c.err) + } + + billingDocuments := make([]*pkg.BillingDocument, 0, len(c.billingDocuments)) + for _, d := range c.billingDocuments { + r, err := c.decodeBillingDocument(d) + if err != nil { + return NewFakeBillingDocumentErroringRawIterator(err) + } + billingDocuments = append(billingDocuments, r) + } + + if c.sorter != nil { + c.sorter(billingDocuments) + } + + return NewFakeBillingDocumentIterator(billingDocuments, 0) +} + +// ListAll lists all BillingDocuments in the database +func (c *FakeBillingDocumentClient) ListAll(ctx context.Context, options *Options) (*pkg.BillingDocuments, error) { + iter := c.List(options) + return iter.Next(ctx, -1) +} + +// Get gets a BillingDocument from the database +func (c *FakeBillingDocumentClient) Get(ctx context.Context, partitionkey string, id string, options *Options) (*pkg.BillingDocument, error) { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return nil, c.err + } + + billingDocument, exists := c.billingDocuments[id] + if !exists { + return nil, &Error{StatusCode: http.StatusNotFound} + } + + return c.decodeBillingDocument(billingDocument) +} + +// Delete deletes a BillingDocument from the database +func (c *FakeBillingDocumentClient) Delete(ctx context.Context, partitionKey string, billingDocument *pkg.BillingDocument, options *Options) error { + c.lock.Lock() + defer c.lock.Unlock() + + if c.err != nil { + return c.err + } + + _, exists := c.billingDocuments[billingDocument.ID] + if !exists { + return &Error{StatusCode: http.StatusNotFound} + } + + delete(c.billingDocuments, billingDocument.ID) + return nil +} + +// ChangeFeed is unimplemented +func (c *FakeBillingDocumentClient) ChangeFeed(*Options) BillingDocumentIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeBillingDocumentErroringRawIterator(c.err) + } + + return NewFakeBillingDocumentErroringRawIterator(ErrNotImplemented) +} + +func (c *FakeBillingDocumentClient) processPreTriggers(ctx context.Context, billingDocument *pkg.BillingDocument, options *Options) error { + for _, triggerName := range options.PreTriggers { + if triggerHandler := c.triggerHandlers[triggerName]; triggerHandler != nil { + err := triggerHandler(ctx, billingDocument) + if err != nil { + return err + } + } else { + return ErrNotImplemented + } + } + + return nil +} + +// Query calls a query handler to implement database querying +func (c *FakeBillingDocumentClient) Query(name string, query *Query, options *Options) BillingDocumentRawIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeBillingDocumentErroringRawIterator(c.err) + } + + if queryHandler := c.queryHandlers[query.Query]; queryHandler != nil { + return queryHandler(c, query, options) + } + + return NewFakeBillingDocumentErroringRawIterator(ErrNotImplemented) +} + +// QueryAll calls a query handler to implement database querying +func (c *FakeBillingDocumentClient) QueryAll(ctx context.Context, partitionkey string, query *Query, options *Options) (*pkg.BillingDocuments, error) { + iter := c.Query("", query, options) + return iter.Next(ctx, -1) +} + +func NewFakeBillingDocumentIterator(billingDocuments []*pkg.BillingDocument, continuation int) BillingDocumentRawIterator { + return &fakeBillingDocumentIterator{billingDocuments: billingDocuments, continuation: continuation} +} + +type fakeBillingDocumentIterator struct { + billingDocuments []*pkg.BillingDocument + continuation int + done bool +} + +func (i *fakeBillingDocumentIterator) NextRaw(ctx context.Context, maxItemCount int, out interface{}) error { + return ErrNotImplemented +} + +func (i *fakeBillingDocumentIterator) Next(ctx context.Context, maxItemCount int) (*pkg.BillingDocuments, error) { + if i.done { + return nil, nil + } + + var billingDocuments []*pkg.BillingDocument + if maxItemCount == -1 { + billingDocuments = i.billingDocuments[i.continuation:] + i.continuation = len(i.billingDocuments) + i.done = true + } else { + max := i.continuation + maxItemCount + if max > len(i.billingDocuments) { + max = len(i.billingDocuments) + } + billingDocuments = i.billingDocuments[i.continuation:max] + i.continuation += max + i.done = i.Continuation() == "" + } + + return &pkg.BillingDocuments{ + BillingDocuments: billingDocuments, + Count: len(billingDocuments), + }, nil +} + +func (i *fakeBillingDocumentIterator) Continuation() string { + if i.continuation >= len(i.billingDocuments) { + return "" + } + return fmt.Sprintf("%d", i.continuation) +} + +// NewFakeBillingDocumentErroringRawIterator returns a BillingDocumentRawIterator which +// whose methods return the given error +func NewFakeBillingDocumentErroringRawIterator(err error) BillingDocumentRawIterator { + return &fakeBillingDocumentErroringRawIterator{err: err} +} + +type fakeBillingDocumentErroringRawIterator struct { + err error +} + +func (i *fakeBillingDocumentErroringRawIterator) Next(ctx context.Context, maxItemCount int) (*pkg.BillingDocuments, error) { + return nil, i.err +} + +func (i *fakeBillingDocumentErroringRawIterator) NextRaw(context.Context, int, interface{}) error { + return i.err +} + +func (i *fakeBillingDocumentErroringRawIterator) Continuation() string { + return "" +} diff --git a/pkg/database/cosmosdb/zz_generated_cosmosdb.go b/pkg/database/cosmosdb/zz_generated_cosmosdb.go index b07f1018b..816c621b5 100644 --- a/pkg/database/cosmosdb/zz_generated_cosmosdb.go +++ b/pkg/database/cosmosdb/zz_generated_cosmosdb.go @@ -53,6 +53,9 @@ func IsErrorStatusCode(err error, statusCode int) bool { // PUT or DELETE operation var ErrETagRequired = fmt.Errorf("ETag is required") +// ErrNotImplemented is the error returned if a fake function is not implemented +var ErrNotImplemented = fmt.Errorf("not implemented") + // RetryOnPreconditionFailed retries a function if it fails due to // PreconditionFailed func RetryOnPreconditionFailed(f func() error) (err error) { diff --git a/pkg/database/cosmosdb/zz_generated_monitordocument.go b/pkg/database/cosmosdb/zz_generated_monitordocument.go index 1370d028b..23249841c 100644 --- a/pkg/database/cosmosdb/zz_generated_monitordocument.go +++ b/pkg/database/cosmosdb/zz_generated_monitordocument.go @@ -19,7 +19,7 @@ type monitorDocumentClient struct { // MonitorDocumentClient is a monitorDocument client type MonitorDocumentClient interface { Create(context.Context, string, *pkg.MonitorDocument, *Options) (*pkg.MonitorDocument, error) - List(*Options) MonitorDocumentRawIterator + List(*Options) MonitorDocumentIterator ListAll(context.Context, *Options) (*pkg.MonitorDocuments, error) Get(context.Context, string, string, *Options) (*pkg.MonitorDocument, error) Replace(context.Context, string, *pkg.MonitorDocument, *Options) (*pkg.MonitorDocument, error) @@ -109,7 +109,7 @@ func (c *monitorDocumentClient) Create(ctx context.Context, partitionkey string, return } -func (c *monitorDocumentClient) List(options *Options) MonitorDocumentRawIterator { +func (c *monitorDocumentClient) List(options *Options) MonitorDocumentIterator { continuation := "" if options != nil { continuation = options.Continuation @@ -239,11 +239,6 @@ func (i *monitorDocumentChangeFeedIterator) Continuation() string { } func (i *monitorDocumentListIterator) Next(ctx context.Context, maxItemCount int) (monitorDocuments *pkg.MonitorDocuments, err error) { - err = i.NextRaw(ctx, maxItemCount, &monitorDocuments) - return -} - -func (i *monitorDocumentListIterator) NextRaw(ctx context.Context, maxItemCount int, raw interface{}) (err error) { if i.done { return } @@ -259,7 +254,7 @@ func (i *monitorDocumentListIterator) NextRaw(ctx context.Context, maxItemCount return } - err = i.do(ctx, http.MethodGet, i.path+"/docs", "docs", i.path, http.StatusOK, nil, &raw, headers) + err = i.do(ctx, http.MethodGet, i.path+"/docs", "docs", i.path, http.StatusOK, nil, &monitorDocuments, headers) if err != nil { return } diff --git a/pkg/database/cosmosdb/zz_generated_monitordocument_fake.go b/pkg/database/cosmosdb/zz_generated_monitordocument_fake.go new file mode 100644 index 000000000..adb5a9e56 --- /dev/null +++ b/pkg/database/cosmosdb/zz_generated_monitordocument_fake.go @@ -0,0 +1,360 @@ +// Code generated by github.com/jim-minter/go-cosmosdb, DO NOT EDIT. + +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + "sync" + + "github.com/ugorji/go/codec" + + pkg "github.com/Azure/ARO-RP/pkg/api" +) + +type fakeMonitorDocumentTriggerHandler func(context.Context, *pkg.MonitorDocument) error +type fakeMonitorDocumentQueryHandler func(MonitorDocumentClient, *Query, *Options) MonitorDocumentRawIterator + +var _ MonitorDocumentClient = &FakeMonitorDocumentClient{} + +// NewFakeMonitorDocumentClient returns a FakeMonitorDocumentClient +func NewFakeMonitorDocumentClient(h *codec.JsonHandle) *FakeMonitorDocumentClient { + return &FakeMonitorDocumentClient{ + monitorDocuments: make(map[string][]byte), + triggerHandlers: make(map[string]fakeMonitorDocumentTriggerHandler), + queryHandlers: make(map[string]fakeMonitorDocumentQueryHandler), + jsonHandle: h, + lock: &sync.RWMutex{}, + } +} + +// FakeMonitorDocumentClient is a FakeMonitorDocumentClient +type FakeMonitorDocumentClient struct { + monitorDocuments map[string][]byte + jsonHandle *codec.JsonHandle + lock *sync.RWMutex + triggerHandlers map[string]fakeMonitorDocumentTriggerHandler + queryHandlers map[string]fakeMonitorDocumentQueryHandler + sorter func([]*pkg.MonitorDocument) + + // returns true if documents conflict + conflictChecker func(*pkg.MonitorDocument, *pkg.MonitorDocument) bool + + // err, if not nil, is an error to return when attempting to communicate + // with this Client + err error +} + +func (c *FakeMonitorDocumentClient) decodeMonitorDocument(s []byte) (monitorDocument *pkg.MonitorDocument, err error) { + err = codec.NewDecoderBytes(s, c.jsonHandle).Decode(&monitorDocument) + return +} + +func (c *FakeMonitorDocumentClient) encodeMonitorDocument(monitorDocument *pkg.MonitorDocument) (b []byte, err error) { + err = codec.NewEncoderBytes(&b, c.jsonHandle).Encode(monitorDocument) + return +} + +// SetError sets or unsets an error that will be returned on any +// FakeMonitorDocumentClient method invocation +func (c *FakeMonitorDocumentClient) SetError(err error) { + c.lock.Lock() + defer c.lock.Unlock() + + c.err = err +} + +// SetSorter sets or unsets a sorter function which will be used to sort values +// returned by List() for test stability +func (c *FakeMonitorDocumentClient) SetSorter(sorter func([]*pkg.MonitorDocument)) { + c.lock.Lock() + defer c.lock.Unlock() + + c.sorter = sorter +} + +// SetConflictChecker sets or unsets a function which can be used to validate +// additional unique keys in a MonitorDocument +func (c *FakeMonitorDocumentClient) SetConflictChecker(conflictChecker func(*pkg.MonitorDocument, *pkg.MonitorDocument) bool) { + c.lock.Lock() + defer c.lock.Unlock() + + c.conflictChecker = conflictChecker +} + +// SetTriggerHandler sets or unsets a trigger handler +func (c *FakeMonitorDocumentClient) SetTriggerHandler(triggerName string, trigger fakeMonitorDocumentTriggerHandler) { + c.lock.Lock() + defer c.lock.Unlock() + + c.triggerHandlers[triggerName] = trigger +} + +// SetQueryHandler sets or unsets a query handler +func (c *FakeMonitorDocumentClient) SetQueryHandler(queryName string, query fakeMonitorDocumentQueryHandler) { + c.lock.Lock() + defer c.lock.Unlock() + + c.queryHandlers[queryName] = query +} + +func (c *FakeMonitorDocumentClient) deepCopy(monitorDocument *pkg.MonitorDocument) (*pkg.MonitorDocument, error) { + b, err := c.encodeMonitorDocument(monitorDocument) + if err != nil { + return nil, err + } + + return c.decodeMonitorDocument(b) +} + +func (c *FakeMonitorDocumentClient) apply(ctx context.Context, partitionkey string, monitorDocument *pkg.MonitorDocument, options *Options, isCreate bool) (*pkg.MonitorDocument, error) { + c.lock.Lock() + defer c.lock.Unlock() + + if c.err != nil { + return nil, c.err + } + + monitorDocument, err := c.deepCopy(monitorDocument) // copy now because pretriggers can mutate monitorDocument + if err != nil { + return nil, err + } + + if options != nil { + err := c.processPreTriggers(ctx, monitorDocument, options) + if err != nil { + return nil, err + } + } + + _, exists := c.monitorDocuments[monitorDocument.ID] + if isCreate && exists { + return nil, &Error{ + StatusCode: http.StatusConflict, + Message: "Entity with the specified id already exists in the system", + } + } + if !isCreate && !exists { + return nil, &Error{StatusCode: http.StatusNotFound} + } + + if c.conflictChecker != nil { + for id := range c.monitorDocuments { + monitorDocumentToCheck, err := c.decodeMonitorDocument(c.monitorDocuments[id]) + if err != nil { + return nil, err + } + + if c.conflictChecker(monitorDocumentToCheck, monitorDocument) { + return nil, &Error{ + StatusCode: http.StatusConflict, + Message: "Entity with the specified id already exists in the system", + } + } + } + } + + b, err := c.encodeMonitorDocument(monitorDocument) + if err != nil { + return nil, err + } + + c.monitorDocuments[monitorDocument.ID] = b + + return monitorDocument, nil +} + +// Create creates a MonitorDocument in the database +func (c *FakeMonitorDocumentClient) Create(ctx context.Context, partitionkey string, monitorDocument *pkg.MonitorDocument, options *Options) (*pkg.MonitorDocument, error) { + return c.apply(ctx, partitionkey, monitorDocument, options, true) +} + +// Replace replaces a MonitorDocument in the database +func (c *FakeMonitorDocumentClient) Replace(ctx context.Context, partitionkey string, monitorDocument *pkg.MonitorDocument, options *Options) (*pkg.MonitorDocument, error) { + return c.apply(ctx, partitionkey, monitorDocument, options, false) +} + +// List returns a MonitorDocumentIterator to list all MonitorDocuments in the database +func (c *FakeMonitorDocumentClient) List(*Options) MonitorDocumentIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeMonitorDocumentErroringRawIterator(c.err) + } + + monitorDocuments := make([]*pkg.MonitorDocument, 0, len(c.monitorDocuments)) + for _, d := range c.monitorDocuments { + r, err := c.decodeMonitorDocument(d) + if err != nil { + return NewFakeMonitorDocumentErroringRawIterator(err) + } + monitorDocuments = append(monitorDocuments, r) + } + + if c.sorter != nil { + c.sorter(monitorDocuments) + } + + return NewFakeMonitorDocumentIterator(monitorDocuments, 0) +} + +// ListAll lists all MonitorDocuments in the database +func (c *FakeMonitorDocumentClient) ListAll(ctx context.Context, options *Options) (*pkg.MonitorDocuments, error) { + iter := c.List(options) + return iter.Next(ctx, -1) +} + +// Get gets a MonitorDocument from the database +func (c *FakeMonitorDocumentClient) Get(ctx context.Context, partitionkey string, id string, options *Options) (*pkg.MonitorDocument, error) { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return nil, c.err + } + + monitorDocument, exists := c.monitorDocuments[id] + if !exists { + return nil, &Error{StatusCode: http.StatusNotFound} + } + + return c.decodeMonitorDocument(monitorDocument) +} + +// Delete deletes a MonitorDocument from the database +func (c *FakeMonitorDocumentClient) Delete(ctx context.Context, partitionKey string, monitorDocument *pkg.MonitorDocument, options *Options) error { + c.lock.Lock() + defer c.lock.Unlock() + + if c.err != nil { + return c.err + } + + _, exists := c.monitorDocuments[monitorDocument.ID] + if !exists { + return &Error{StatusCode: http.StatusNotFound} + } + + delete(c.monitorDocuments, monitorDocument.ID) + return nil +} + +// ChangeFeed is unimplemented +func (c *FakeMonitorDocumentClient) ChangeFeed(*Options) MonitorDocumentIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeMonitorDocumentErroringRawIterator(c.err) + } + + return NewFakeMonitorDocumentErroringRawIterator(ErrNotImplemented) +} + +func (c *FakeMonitorDocumentClient) processPreTriggers(ctx context.Context, monitorDocument *pkg.MonitorDocument, options *Options) error { + for _, triggerName := range options.PreTriggers { + if triggerHandler := c.triggerHandlers[triggerName]; triggerHandler != nil { + err := triggerHandler(ctx, monitorDocument) + if err != nil { + return err + } + } else { + return ErrNotImplemented + } + } + + return nil +} + +// Query calls a query handler to implement database querying +func (c *FakeMonitorDocumentClient) Query(name string, query *Query, options *Options) MonitorDocumentRawIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeMonitorDocumentErroringRawIterator(c.err) + } + + if queryHandler := c.queryHandlers[query.Query]; queryHandler != nil { + return queryHandler(c, query, options) + } + + return NewFakeMonitorDocumentErroringRawIterator(ErrNotImplemented) +} + +// QueryAll calls a query handler to implement database querying +func (c *FakeMonitorDocumentClient) QueryAll(ctx context.Context, partitionkey string, query *Query, options *Options) (*pkg.MonitorDocuments, error) { + iter := c.Query("", query, options) + return iter.Next(ctx, -1) +} + +func NewFakeMonitorDocumentIterator(monitorDocuments []*pkg.MonitorDocument, continuation int) MonitorDocumentRawIterator { + return &fakeMonitorDocumentIterator{monitorDocuments: monitorDocuments, continuation: continuation} +} + +type fakeMonitorDocumentIterator struct { + monitorDocuments []*pkg.MonitorDocument + continuation int + done bool +} + +func (i *fakeMonitorDocumentIterator) NextRaw(ctx context.Context, maxItemCount int, out interface{}) error { + return ErrNotImplemented +} + +func (i *fakeMonitorDocumentIterator) Next(ctx context.Context, maxItemCount int) (*pkg.MonitorDocuments, error) { + if i.done { + return nil, nil + } + + var monitorDocuments []*pkg.MonitorDocument + if maxItemCount == -1 { + monitorDocuments = i.monitorDocuments[i.continuation:] + i.continuation = len(i.monitorDocuments) + i.done = true + } else { + max := i.continuation + maxItemCount + if max > len(i.monitorDocuments) { + max = len(i.monitorDocuments) + } + monitorDocuments = i.monitorDocuments[i.continuation:max] + i.continuation += max + i.done = i.Continuation() == "" + } + + return &pkg.MonitorDocuments{ + MonitorDocuments: monitorDocuments, + Count: len(monitorDocuments), + }, nil +} + +func (i *fakeMonitorDocumentIterator) Continuation() string { + if i.continuation >= len(i.monitorDocuments) { + return "" + } + return fmt.Sprintf("%d", i.continuation) +} + +// NewFakeMonitorDocumentErroringRawIterator returns a MonitorDocumentRawIterator which +// whose methods return the given error +func NewFakeMonitorDocumentErroringRawIterator(err error) MonitorDocumentRawIterator { + return &fakeMonitorDocumentErroringRawIterator{err: err} +} + +type fakeMonitorDocumentErroringRawIterator struct { + err error +} + +func (i *fakeMonitorDocumentErroringRawIterator) Next(ctx context.Context, maxItemCount int) (*pkg.MonitorDocuments, error) { + return nil, i.err +} + +func (i *fakeMonitorDocumentErroringRawIterator) NextRaw(context.Context, int, interface{}) error { + return i.err +} + +func (i *fakeMonitorDocumentErroringRawIterator) Continuation() string { + return "" +} diff --git a/pkg/database/cosmosdb/zz_generated_openshiftclusterdocument.go b/pkg/database/cosmosdb/zz_generated_openshiftclusterdocument.go index 7da32684f..d197d8ff8 100644 --- a/pkg/database/cosmosdb/zz_generated_openshiftclusterdocument.go +++ b/pkg/database/cosmosdb/zz_generated_openshiftclusterdocument.go @@ -19,7 +19,7 @@ type openShiftClusterDocumentClient struct { // OpenShiftClusterDocumentClient is a openShiftClusterDocument client type OpenShiftClusterDocumentClient interface { Create(context.Context, string, *pkg.OpenShiftClusterDocument, *Options) (*pkg.OpenShiftClusterDocument, error) - List(*Options) OpenShiftClusterDocumentRawIterator + List(*Options) OpenShiftClusterDocumentIterator ListAll(context.Context, *Options) (*pkg.OpenShiftClusterDocuments, error) Get(context.Context, string, string, *Options) (*pkg.OpenShiftClusterDocument, error) Replace(context.Context, string, *pkg.OpenShiftClusterDocument, *Options) (*pkg.OpenShiftClusterDocument, error) @@ -109,7 +109,7 @@ func (c *openShiftClusterDocumentClient) Create(ctx context.Context, partitionke return } -func (c *openShiftClusterDocumentClient) List(options *Options) OpenShiftClusterDocumentRawIterator { +func (c *openShiftClusterDocumentClient) List(options *Options) OpenShiftClusterDocumentIterator { continuation := "" if options != nil { continuation = options.Continuation @@ -239,11 +239,6 @@ func (i *openShiftClusterDocumentChangeFeedIterator) Continuation() string { } func (i *openShiftClusterDocumentListIterator) Next(ctx context.Context, maxItemCount int) (openShiftClusterDocuments *pkg.OpenShiftClusterDocuments, err error) { - err = i.NextRaw(ctx, maxItemCount, &openShiftClusterDocuments) - return -} - -func (i *openShiftClusterDocumentListIterator) NextRaw(ctx context.Context, maxItemCount int, raw interface{}) (err error) { if i.done { return } @@ -259,7 +254,7 @@ func (i *openShiftClusterDocumentListIterator) NextRaw(ctx context.Context, maxI return } - err = i.do(ctx, http.MethodGet, i.path+"/docs", "docs", i.path, http.StatusOK, nil, &raw, headers) + err = i.do(ctx, http.MethodGet, i.path+"/docs", "docs", i.path, http.StatusOK, nil, &openShiftClusterDocuments, headers) if err != nil { return } diff --git a/pkg/database/cosmosdb/zz_generated_openshiftclusterdocument_fake.go b/pkg/database/cosmosdb/zz_generated_openshiftclusterdocument_fake.go new file mode 100644 index 000000000..890fa5b25 --- /dev/null +++ b/pkg/database/cosmosdb/zz_generated_openshiftclusterdocument_fake.go @@ -0,0 +1,360 @@ +// Code generated by github.com/jim-minter/go-cosmosdb, DO NOT EDIT. + +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + "sync" + + "github.com/ugorji/go/codec" + + pkg "github.com/Azure/ARO-RP/pkg/api" +) + +type fakeOpenShiftClusterDocumentTriggerHandler func(context.Context, *pkg.OpenShiftClusterDocument) error +type fakeOpenShiftClusterDocumentQueryHandler func(OpenShiftClusterDocumentClient, *Query, *Options) OpenShiftClusterDocumentRawIterator + +var _ OpenShiftClusterDocumentClient = &FakeOpenShiftClusterDocumentClient{} + +// NewFakeOpenShiftClusterDocumentClient returns a FakeOpenShiftClusterDocumentClient +func NewFakeOpenShiftClusterDocumentClient(h *codec.JsonHandle) *FakeOpenShiftClusterDocumentClient { + return &FakeOpenShiftClusterDocumentClient{ + openShiftClusterDocuments: make(map[string][]byte), + triggerHandlers: make(map[string]fakeOpenShiftClusterDocumentTriggerHandler), + queryHandlers: make(map[string]fakeOpenShiftClusterDocumentQueryHandler), + jsonHandle: h, + lock: &sync.RWMutex{}, + } +} + +// FakeOpenShiftClusterDocumentClient is a FakeOpenShiftClusterDocumentClient +type FakeOpenShiftClusterDocumentClient struct { + openShiftClusterDocuments map[string][]byte + jsonHandle *codec.JsonHandle + lock *sync.RWMutex + triggerHandlers map[string]fakeOpenShiftClusterDocumentTriggerHandler + queryHandlers map[string]fakeOpenShiftClusterDocumentQueryHandler + sorter func([]*pkg.OpenShiftClusterDocument) + + // returns true if documents conflict + conflictChecker func(*pkg.OpenShiftClusterDocument, *pkg.OpenShiftClusterDocument) bool + + // err, if not nil, is an error to return when attempting to communicate + // with this Client + err error +} + +func (c *FakeOpenShiftClusterDocumentClient) decodeOpenShiftClusterDocument(s []byte) (openShiftClusterDocument *pkg.OpenShiftClusterDocument, err error) { + err = codec.NewDecoderBytes(s, c.jsonHandle).Decode(&openShiftClusterDocument) + return +} + +func (c *FakeOpenShiftClusterDocumentClient) encodeOpenShiftClusterDocument(openShiftClusterDocument *pkg.OpenShiftClusterDocument) (b []byte, err error) { + err = codec.NewEncoderBytes(&b, c.jsonHandle).Encode(openShiftClusterDocument) + return +} + +// SetError sets or unsets an error that will be returned on any +// FakeOpenShiftClusterDocumentClient method invocation +func (c *FakeOpenShiftClusterDocumentClient) SetError(err error) { + c.lock.Lock() + defer c.lock.Unlock() + + c.err = err +} + +// SetSorter sets or unsets a sorter function which will be used to sort values +// returned by List() for test stability +func (c *FakeOpenShiftClusterDocumentClient) SetSorter(sorter func([]*pkg.OpenShiftClusterDocument)) { + c.lock.Lock() + defer c.lock.Unlock() + + c.sorter = sorter +} + +// SetConflictChecker sets or unsets a function which can be used to validate +// additional unique keys in a OpenShiftClusterDocument +func (c *FakeOpenShiftClusterDocumentClient) SetConflictChecker(conflictChecker func(*pkg.OpenShiftClusterDocument, *pkg.OpenShiftClusterDocument) bool) { + c.lock.Lock() + defer c.lock.Unlock() + + c.conflictChecker = conflictChecker +} + +// SetTriggerHandler sets or unsets a trigger handler +func (c *FakeOpenShiftClusterDocumentClient) SetTriggerHandler(triggerName string, trigger fakeOpenShiftClusterDocumentTriggerHandler) { + c.lock.Lock() + defer c.lock.Unlock() + + c.triggerHandlers[triggerName] = trigger +} + +// SetQueryHandler sets or unsets a query handler +func (c *FakeOpenShiftClusterDocumentClient) SetQueryHandler(queryName string, query fakeOpenShiftClusterDocumentQueryHandler) { + c.lock.Lock() + defer c.lock.Unlock() + + c.queryHandlers[queryName] = query +} + +func (c *FakeOpenShiftClusterDocumentClient) deepCopy(openShiftClusterDocument *pkg.OpenShiftClusterDocument) (*pkg.OpenShiftClusterDocument, error) { + b, err := c.encodeOpenShiftClusterDocument(openShiftClusterDocument) + if err != nil { + return nil, err + } + + return c.decodeOpenShiftClusterDocument(b) +} + +func (c *FakeOpenShiftClusterDocumentClient) apply(ctx context.Context, partitionkey string, openShiftClusterDocument *pkg.OpenShiftClusterDocument, options *Options, isCreate bool) (*pkg.OpenShiftClusterDocument, error) { + c.lock.Lock() + defer c.lock.Unlock() + + if c.err != nil { + return nil, c.err + } + + openShiftClusterDocument, err := c.deepCopy(openShiftClusterDocument) // copy now because pretriggers can mutate openShiftClusterDocument + if err != nil { + return nil, err + } + + if options != nil { + err := c.processPreTriggers(ctx, openShiftClusterDocument, options) + if err != nil { + return nil, err + } + } + + _, exists := c.openShiftClusterDocuments[openShiftClusterDocument.ID] + if isCreate && exists { + return nil, &Error{ + StatusCode: http.StatusConflict, + Message: "Entity with the specified id already exists in the system", + } + } + if !isCreate && !exists { + return nil, &Error{StatusCode: http.StatusNotFound} + } + + if c.conflictChecker != nil { + for id := range c.openShiftClusterDocuments { + openShiftClusterDocumentToCheck, err := c.decodeOpenShiftClusterDocument(c.openShiftClusterDocuments[id]) + if err != nil { + return nil, err + } + + if c.conflictChecker(openShiftClusterDocumentToCheck, openShiftClusterDocument) { + return nil, &Error{ + StatusCode: http.StatusConflict, + Message: "Entity with the specified id already exists in the system", + } + } + } + } + + b, err := c.encodeOpenShiftClusterDocument(openShiftClusterDocument) + if err != nil { + return nil, err + } + + c.openShiftClusterDocuments[openShiftClusterDocument.ID] = b + + return openShiftClusterDocument, nil +} + +// Create creates a OpenShiftClusterDocument in the database +func (c *FakeOpenShiftClusterDocumentClient) Create(ctx context.Context, partitionkey string, openShiftClusterDocument *pkg.OpenShiftClusterDocument, options *Options) (*pkg.OpenShiftClusterDocument, error) { + return c.apply(ctx, partitionkey, openShiftClusterDocument, options, true) +} + +// Replace replaces a OpenShiftClusterDocument in the database +func (c *FakeOpenShiftClusterDocumentClient) Replace(ctx context.Context, partitionkey string, openShiftClusterDocument *pkg.OpenShiftClusterDocument, options *Options) (*pkg.OpenShiftClusterDocument, error) { + return c.apply(ctx, partitionkey, openShiftClusterDocument, options, false) +} + +// List returns a OpenShiftClusterDocumentIterator to list all OpenShiftClusterDocuments in the database +func (c *FakeOpenShiftClusterDocumentClient) List(*Options) OpenShiftClusterDocumentIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeOpenShiftClusterDocumentErroringRawIterator(c.err) + } + + openShiftClusterDocuments := make([]*pkg.OpenShiftClusterDocument, 0, len(c.openShiftClusterDocuments)) + for _, d := range c.openShiftClusterDocuments { + r, err := c.decodeOpenShiftClusterDocument(d) + if err != nil { + return NewFakeOpenShiftClusterDocumentErroringRawIterator(err) + } + openShiftClusterDocuments = append(openShiftClusterDocuments, r) + } + + if c.sorter != nil { + c.sorter(openShiftClusterDocuments) + } + + return NewFakeOpenShiftClusterDocumentIterator(openShiftClusterDocuments, 0) +} + +// ListAll lists all OpenShiftClusterDocuments in the database +func (c *FakeOpenShiftClusterDocumentClient) ListAll(ctx context.Context, options *Options) (*pkg.OpenShiftClusterDocuments, error) { + iter := c.List(options) + return iter.Next(ctx, -1) +} + +// Get gets a OpenShiftClusterDocument from the database +func (c *FakeOpenShiftClusterDocumentClient) Get(ctx context.Context, partitionkey string, id string, options *Options) (*pkg.OpenShiftClusterDocument, error) { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return nil, c.err + } + + openShiftClusterDocument, exists := c.openShiftClusterDocuments[id] + if !exists { + return nil, &Error{StatusCode: http.StatusNotFound} + } + + return c.decodeOpenShiftClusterDocument(openShiftClusterDocument) +} + +// Delete deletes a OpenShiftClusterDocument from the database +func (c *FakeOpenShiftClusterDocumentClient) Delete(ctx context.Context, partitionKey string, openShiftClusterDocument *pkg.OpenShiftClusterDocument, options *Options) error { + c.lock.Lock() + defer c.lock.Unlock() + + if c.err != nil { + return c.err + } + + _, exists := c.openShiftClusterDocuments[openShiftClusterDocument.ID] + if !exists { + return &Error{StatusCode: http.StatusNotFound} + } + + delete(c.openShiftClusterDocuments, openShiftClusterDocument.ID) + return nil +} + +// ChangeFeed is unimplemented +func (c *FakeOpenShiftClusterDocumentClient) ChangeFeed(*Options) OpenShiftClusterDocumentIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeOpenShiftClusterDocumentErroringRawIterator(c.err) + } + + return NewFakeOpenShiftClusterDocumentErroringRawIterator(ErrNotImplemented) +} + +func (c *FakeOpenShiftClusterDocumentClient) processPreTriggers(ctx context.Context, openShiftClusterDocument *pkg.OpenShiftClusterDocument, options *Options) error { + for _, triggerName := range options.PreTriggers { + if triggerHandler := c.triggerHandlers[triggerName]; triggerHandler != nil { + err := triggerHandler(ctx, openShiftClusterDocument) + if err != nil { + return err + } + } else { + return ErrNotImplemented + } + } + + return nil +} + +// Query calls a query handler to implement database querying +func (c *FakeOpenShiftClusterDocumentClient) Query(name string, query *Query, options *Options) OpenShiftClusterDocumentRawIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeOpenShiftClusterDocumentErroringRawIterator(c.err) + } + + if queryHandler := c.queryHandlers[query.Query]; queryHandler != nil { + return queryHandler(c, query, options) + } + + return NewFakeOpenShiftClusterDocumentErroringRawIterator(ErrNotImplemented) +} + +// QueryAll calls a query handler to implement database querying +func (c *FakeOpenShiftClusterDocumentClient) QueryAll(ctx context.Context, partitionkey string, query *Query, options *Options) (*pkg.OpenShiftClusterDocuments, error) { + iter := c.Query("", query, options) + return iter.Next(ctx, -1) +} + +func NewFakeOpenShiftClusterDocumentIterator(openShiftClusterDocuments []*pkg.OpenShiftClusterDocument, continuation int) OpenShiftClusterDocumentRawIterator { + return &fakeOpenShiftClusterDocumentIterator{openShiftClusterDocuments: openShiftClusterDocuments, continuation: continuation} +} + +type fakeOpenShiftClusterDocumentIterator struct { + openShiftClusterDocuments []*pkg.OpenShiftClusterDocument + continuation int + done bool +} + +func (i *fakeOpenShiftClusterDocumentIterator) NextRaw(ctx context.Context, maxItemCount int, out interface{}) error { + return ErrNotImplemented +} + +func (i *fakeOpenShiftClusterDocumentIterator) Next(ctx context.Context, maxItemCount int) (*pkg.OpenShiftClusterDocuments, error) { + if i.done { + return nil, nil + } + + var openShiftClusterDocuments []*pkg.OpenShiftClusterDocument + if maxItemCount == -1 { + openShiftClusterDocuments = i.openShiftClusterDocuments[i.continuation:] + i.continuation = len(i.openShiftClusterDocuments) + i.done = true + } else { + max := i.continuation + maxItemCount + if max > len(i.openShiftClusterDocuments) { + max = len(i.openShiftClusterDocuments) + } + openShiftClusterDocuments = i.openShiftClusterDocuments[i.continuation:max] + i.continuation += max + i.done = i.Continuation() == "" + } + + return &pkg.OpenShiftClusterDocuments{ + OpenShiftClusterDocuments: openShiftClusterDocuments, + Count: len(openShiftClusterDocuments), + }, nil +} + +func (i *fakeOpenShiftClusterDocumentIterator) Continuation() string { + if i.continuation >= len(i.openShiftClusterDocuments) { + return "" + } + return fmt.Sprintf("%d", i.continuation) +} + +// NewFakeOpenShiftClusterDocumentErroringRawIterator returns a OpenShiftClusterDocumentRawIterator which +// whose methods return the given error +func NewFakeOpenShiftClusterDocumentErroringRawIterator(err error) OpenShiftClusterDocumentRawIterator { + return &fakeOpenShiftClusterDocumentErroringRawIterator{err: err} +} + +type fakeOpenShiftClusterDocumentErroringRawIterator struct { + err error +} + +func (i *fakeOpenShiftClusterDocumentErroringRawIterator) Next(ctx context.Context, maxItemCount int) (*pkg.OpenShiftClusterDocuments, error) { + return nil, i.err +} + +func (i *fakeOpenShiftClusterDocumentErroringRawIterator) NextRaw(context.Context, int, interface{}) error { + return i.err +} + +func (i *fakeOpenShiftClusterDocumentErroringRawIterator) Continuation() string { + return "" +} diff --git a/pkg/database/cosmosdb/zz_generated_subscriptiondocument.go b/pkg/database/cosmosdb/zz_generated_subscriptiondocument.go index 8d37d47bb..448ec3147 100644 --- a/pkg/database/cosmosdb/zz_generated_subscriptiondocument.go +++ b/pkg/database/cosmosdb/zz_generated_subscriptiondocument.go @@ -19,7 +19,7 @@ type subscriptionDocumentClient struct { // SubscriptionDocumentClient is a subscriptionDocument client type SubscriptionDocumentClient interface { Create(context.Context, string, *pkg.SubscriptionDocument, *Options) (*pkg.SubscriptionDocument, error) - List(*Options) SubscriptionDocumentRawIterator + List(*Options) SubscriptionDocumentIterator ListAll(context.Context, *Options) (*pkg.SubscriptionDocuments, error) Get(context.Context, string, string, *Options) (*pkg.SubscriptionDocument, error) Replace(context.Context, string, *pkg.SubscriptionDocument, *Options) (*pkg.SubscriptionDocument, error) @@ -109,7 +109,7 @@ func (c *subscriptionDocumentClient) Create(ctx context.Context, partitionkey st return } -func (c *subscriptionDocumentClient) List(options *Options) SubscriptionDocumentRawIterator { +func (c *subscriptionDocumentClient) List(options *Options) SubscriptionDocumentIterator { continuation := "" if options != nil { continuation = options.Continuation @@ -239,11 +239,6 @@ func (i *subscriptionDocumentChangeFeedIterator) Continuation() string { } func (i *subscriptionDocumentListIterator) Next(ctx context.Context, maxItemCount int) (subscriptionDocuments *pkg.SubscriptionDocuments, err error) { - err = i.NextRaw(ctx, maxItemCount, &subscriptionDocuments) - return -} - -func (i *subscriptionDocumentListIterator) NextRaw(ctx context.Context, maxItemCount int, raw interface{}) (err error) { if i.done { return } @@ -259,7 +254,7 @@ func (i *subscriptionDocumentListIterator) NextRaw(ctx context.Context, maxItemC return } - err = i.do(ctx, http.MethodGet, i.path+"/docs", "docs", i.path, http.StatusOK, nil, &raw, headers) + err = i.do(ctx, http.MethodGet, i.path+"/docs", "docs", i.path, http.StatusOK, nil, &subscriptionDocuments, headers) if err != nil { return } diff --git a/pkg/database/cosmosdb/zz_generated_subscriptiondocument_fake.go b/pkg/database/cosmosdb/zz_generated_subscriptiondocument_fake.go new file mode 100644 index 000000000..fc1352e63 --- /dev/null +++ b/pkg/database/cosmosdb/zz_generated_subscriptiondocument_fake.go @@ -0,0 +1,360 @@ +// Code generated by github.com/jim-minter/go-cosmosdb, DO NOT EDIT. + +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + "sync" + + "github.com/ugorji/go/codec" + + pkg "github.com/Azure/ARO-RP/pkg/api" +) + +type fakeSubscriptionDocumentTriggerHandler func(context.Context, *pkg.SubscriptionDocument) error +type fakeSubscriptionDocumentQueryHandler func(SubscriptionDocumentClient, *Query, *Options) SubscriptionDocumentRawIterator + +var _ SubscriptionDocumentClient = &FakeSubscriptionDocumentClient{} + +// NewFakeSubscriptionDocumentClient returns a FakeSubscriptionDocumentClient +func NewFakeSubscriptionDocumentClient(h *codec.JsonHandle) *FakeSubscriptionDocumentClient { + return &FakeSubscriptionDocumentClient{ + subscriptionDocuments: make(map[string][]byte), + triggerHandlers: make(map[string]fakeSubscriptionDocumentTriggerHandler), + queryHandlers: make(map[string]fakeSubscriptionDocumentQueryHandler), + jsonHandle: h, + lock: &sync.RWMutex{}, + } +} + +// FakeSubscriptionDocumentClient is a FakeSubscriptionDocumentClient +type FakeSubscriptionDocumentClient struct { + subscriptionDocuments map[string][]byte + jsonHandle *codec.JsonHandle + lock *sync.RWMutex + triggerHandlers map[string]fakeSubscriptionDocumentTriggerHandler + queryHandlers map[string]fakeSubscriptionDocumentQueryHandler + sorter func([]*pkg.SubscriptionDocument) + + // returns true if documents conflict + conflictChecker func(*pkg.SubscriptionDocument, *pkg.SubscriptionDocument) bool + + // err, if not nil, is an error to return when attempting to communicate + // with this Client + err error +} + +func (c *FakeSubscriptionDocumentClient) decodeSubscriptionDocument(s []byte) (subscriptionDocument *pkg.SubscriptionDocument, err error) { + err = codec.NewDecoderBytes(s, c.jsonHandle).Decode(&subscriptionDocument) + return +} + +func (c *FakeSubscriptionDocumentClient) encodeSubscriptionDocument(subscriptionDocument *pkg.SubscriptionDocument) (b []byte, err error) { + err = codec.NewEncoderBytes(&b, c.jsonHandle).Encode(subscriptionDocument) + return +} + +// SetError sets or unsets an error that will be returned on any +// FakeSubscriptionDocumentClient method invocation +func (c *FakeSubscriptionDocumentClient) SetError(err error) { + c.lock.Lock() + defer c.lock.Unlock() + + c.err = err +} + +// SetSorter sets or unsets a sorter function which will be used to sort values +// returned by List() for test stability +func (c *FakeSubscriptionDocumentClient) SetSorter(sorter func([]*pkg.SubscriptionDocument)) { + c.lock.Lock() + defer c.lock.Unlock() + + c.sorter = sorter +} + +// SetConflictChecker sets or unsets a function which can be used to validate +// additional unique keys in a SubscriptionDocument +func (c *FakeSubscriptionDocumentClient) SetConflictChecker(conflictChecker func(*pkg.SubscriptionDocument, *pkg.SubscriptionDocument) bool) { + c.lock.Lock() + defer c.lock.Unlock() + + c.conflictChecker = conflictChecker +} + +// SetTriggerHandler sets or unsets a trigger handler +func (c *FakeSubscriptionDocumentClient) SetTriggerHandler(triggerName string, trigger fakeSubscriptionDocumentTriggerHandler) { + c.lock.Lock() + defer c.lock.Unlock() + + c.triggerHandlers[triggerName] = trigger +} + +// SetQueryHandler sets or unsets a query handler +func (c *FakeSubscriptionDocumentClient) SetQueryHandler(queryName string, query fakeSubscriptionDocumentQueryHandler) { + c.lock.Lock() + defer c.lock.Unlock() + + c.queryHandlers[queryName] = query +} + +func (c *FakeSubscriptionDocumentClient) deepCopy(subscriptionDocument *pkg.SubscriptionDocument) (*pkg.SubscriptionDocument, error) { + b, err := c.encodeSubscriptionDocument(subscriptionDocument) + if err != nil { + return nil, err + } + + return c.decodeSubscriptionDocument(b) +} + +func (c *FakeSubscriptionDocumentClient) apply(ctx context.Context, partitionkey string, subscriptionDocument *pkg.SubscriptionDocument, options *Options, isCreate bool) (*pkg.SubscriptionDocument, error) { + c.lock.Lock() + defer c.lock.Unlock() + + if c.err != nil { + return nil, c.err + } + + subscriptionDocument, err := c.deepCopy(subscriptionDocument) // copy now because pretriggers can mutate subscriptionDocument + if err != nil { + return nil, err + } + + if options != nil { + err := c.processPreTriggers(ctx, subscriptionDocument, options) + if err != nil { + return nil, err + } + } + + _, exists := c.subscriptionDocuments[subscriptionDocument.ID] + if isCreate && exists { + return nil, &Error{ + StatusCode: http.StatusConflict, + Message: "Entity with the specified id already exists in the system", + } + } + if !isCreate && !exists { + return nil, &Error{StatusCode: http.StatusNotFound} + } + + if c.conflictChecker != nil { + for id := range c.subscriptionDocuments { + subscriptionDocumentToCheck, err := c.decodeSubscriptionDocument(c.subscriptionDocuments[id]) + if err != nil { + return nil, err + } + + if c.conflictChecker(subscriptionDocumentToCheck, subscriptionDocument) { + return nil, &Error{ + StatusCode: http.StatusConflict, + Message: "Entity with the specified id already exists in the system", + } + } + } + } + + b, err := c.encodeSubscriptionDocument(subscriptionDocument) + if err != nil { + return nil, err + } + + c.subscriptionDocuments[subscriptionDocument.ID] = b + + return subscriptionDocument, nil +} + +// Create creates a SubscriptionDocument in the database +func (c *FakeSubscriptionDocumentClient) Create(ctx context.Context, partitionkey string, subscriptionDocument *pkg.SubscriptionDocument, options *Options) (*pkg.SubscriptionDocument, error) { + return c.apply(ctx, partitionkey, subscriptionDocument, options, true) +} + +// Replace replaces a SubscriptionDocument in the database +func (c *FakeSubscriptionDocumentClient) Replace(ctx context.Context, partitionkey string, subscriptionDocument *pkg.SubscriptionDocument, options *Options) (*pkg.SubscriptionDocument, error) { + return c.apply(ctx, partitionkey, subscriptionDocument, options, false) +} + +// List returns a SubscriptionDocumentIterator to list all SubscriptionDocuments in the database +func (c *FakeSubscriptionDocumentClient) List(*Options) SubscriptionDocumentIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeSubscriptionDocumentErroringRawIterator(c.err) + } + + subscriptionDocuments := make([]*pkg.SubscriptionDocument, 0, len(c.subscriptionDocuments)) + for _, d := range c.subscriptionDocuments { + r, err := c.decodeSubscriptionDocument(d) + if err != nil { + return NewFakeSubscriptionDocumentErroringRawIterator(err) + } + subscriptionDocuments = append(subscriptionDocuments, r) + } + + if c.sorter != nil { + c.sorter(subscriptionDocuments) + } + + return NewFakeSubscriptionDocumentIterator(subscriptionDocuments, 0) +} + +// ListAll lists all SubscriptionDocuments in the database +func (c *FakeSubscriptionDocumentClient) ListAll(ctx context.Context, options *Options) (*pkg.SubscriptionDocuments, error) { + iter := c.List(options) + return iter.Next(ctx, -1) +} + +// Get gets a SubscriptionDocument from the database +func (c *FakeSubscriptionDocumentClient) Get(ctx context.Context, partitionkey string, id string, options *Options) (*pkg.SubscriptionDocument, error) { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return nil, c.err + } + + subscriptionDocument, exists := c.subscriptionDocuments[id] + if !exists { + return nil, &Error{StatusCode: http.StatusNotFound} + } + + return c.decodeSubscriptionDocument(subscriptionDocument) +} + +// Delete deletes a SubscriptionDocument from the database +func (c *FakeSubscriptionDocumentClient) Delete(ctx context.Context, partitionKey string, subscriptionDocument *pkg.SubscriptionDocument, options *Options) error { + c.lock.Lock() + defer c.lock.Unlock() + + if c.err != nil { + return c.err + } + + _, exists := c.subscriptionDocuments[subscriptionDocument.ID] + if !exists { + return &Error{StatusCode: http.StatusNotFound} + } + + delete(c.subscriptionDocuments, subscriptionDocument.ID) + return nil +} + +// ChangeFeed is unimplemented +func (c *FakeSubscriptionDocumentClient) ChangeFeed(*Options) SubscriptionDocumentIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeSubscriptionDocumentErroringRawIterator(c.err) + } + + return NewFakeSubscriptionDocumentErroringRawIterator(ErrNotImplemented) +} + +func (c *FakeSubscriptionDocumentClient) processPreTriggers(ctx context.Context, subscriptionDocument *pkg.SubscriptionDocument, options *Options) error { + for _, triggerName := range options.PreTriggers { + if triggerHandler := c.triggerHandlers[triggerName]; triggerHandler != nil { + err := triggerHandler(ctx, subscriptionDocument) + if err != nil { + return err + } + } else { + return ErrNotImplemented + } + } + + return nil +} + +// Query calls a query handler to implement database querying +func (c *FakeSubscriptionDocumentClient) Query(name string, query *Query, options *Options) SubscriptionDocumentRawIterator { + c.lock.RLock() + defer c.lock.RUnlock() + + if c.err != nil { + return NewFakeSubscriptionDocumentErroringRawIterator(c.err) + } + + if queryHandler := c.queryHandlers[query.Query]; queryHandler != nil { + return queryHandler(c, query, options) + } + + return NewFakeSubscriptionDocumentErroringRawIterator(ErrNotImplemented) +} + +// QueryAll calls a query handler to implement database querying +func (c *FakeSubscriptionDocumentClient) QueryAll(ctx context.Context, partitionkey string, query *Query, options *Options) (*pkg.SubscriptionDocuments, error) { + iter := c.Query("", query, options) + return iter.Next(ctx, -1) +} + +func NewFakeSubscriptionDocumentIterator(subscriptionDocuments []*pkg.SubscriptionDocument, continuation int) SubscriptionDocumentRawIterator { + return &fakeSubscriptionDocumentIterator{subscriptionDocuments: subscriptionDocuments, continuation: continuation} +} + +type fakeSubscriptionDocumentIterator struct { + subscriptionDocuments []*pkg.SubscriptionDocument + continuation int + done bool +} + +func (i *fakeSubscriptionDocumentIterator) NextRaw(ctx context.Context, maxItemCount int, out interface{}) error { + return ErrNotImplemented +} + +func (i *fakeSubscriptionDocumentIterator) Next(ctx context.Context, maxItemCount int) (*pkg.SubscriptionDocuments, error) { + if i.done { + return nil, nil + } + + var subscriptionDocuments []*pkg.SubscriptionDocument + if maxItemCount == -1 { + subscriptionDocuments = i.subscriptionDocuments[i.continuation:] + i.continuation = len(i.subscriptionDocuments) + i.done = true + } else { + max := i.continuation + maxItemCount + if max > len(i.subscriptionDocuments) { + max = len(i.subscriptionDocuments) + } + subscriptionDocuments = i.subscriptionDocuments[i.continuation:max] + i.continuation += max + i.done = i.Continuation() == "" + } + + return &pkg.SubscriptionDocuments{ + SubscriptionDocuments: subscriptionDocuments, + Count: len(subscriptionDocuments), + }, nil +} + +func (i *fakeSubscriptionDocumentIterator) Continuation() string { + if i.continuation >= len(i.subscriptionDocuments) { + return "" + } + return fmt.Sprintf("%d", i.continuation) +} + +// NewFakeSubscriptionDocumentErroringRawIterator returns a SubscriptionDocumentRawIterator which +// whose methods return the given error +func NewFakeSubscriptionDocumentErroringRawIterator(err error) SubscriptionDocumentRawIterator { + return &fakeSubscriptionDocumentErroringRawIterator{err: err} +} + +type fakeSubscriptionDocumentErroringRawIterator struct { + err error +} + +func (i *fakeSubscriptionDocumentErroringRawIterator) Next(ctx context.Context, maxItemCount int) (*pkg.SubscriptionDocuments, error) { + return nil, i.err +} + +func (i *fakeSubscriptionDocumentErroringRawIterator) NextRaw(context.Context, int, interface{}) error { + return i.err +} + +func (i *fakeSubscriptionDocumentErroringRawIterator) Continuation() string { + return "" +} diff --git a/vendor/github.com/jim-minter/go-cosmosdb/cmd/gencosmosdb/gencosmosdb.go b/vendor/github.com/jim-minter/go-cosmosdb/cmd/gencosmosdb/gencosmosdb.go index d2e0dd611..6569b2e9a 100644 --- a/vendor/github.com/jim-minter/go-cosmosdb/cmd/gencosmosdb/gencosmosdb.go +++ b/vendor/github.com/jim-minter/go-cosmosdb/cmd/gencosmosdb/gencosmosdb.go @@ -43,7 +43,7 @@ func unexport(s string) string { func run() error { for _, name := range gencosmosdb.AssetNames() { - if name == "template.go" { + if name == "template.go" || name == "template_fake.go" { continue } @@ -54,6 +54,7 @@ func run() error { } for _, arg := range flag.Args() { + filesToGenerate := []string{"template.go", "template_fake.go"} args := strings.Split(arg, ",") importpkg := args[0] @@ -65,19 +66,21 @@ func run() error { singular := unexport(singularExported) plural := unexport(pluralExported) - data := gencosmosdb.MustAsset("template.go") + for _, filename := range filesToGenerate { + data := gencosmosdb.MustAsset(filename) + data = importRegexp.ReplaceAll(data, []byte("\tpkg \""+importpkg+"\"")) - data = importRegexp.ReplaceAll(data, []byte("\tpkg \""+importpkg+"\"")) + // plural must be done before singular ("template" is a sub-string of "templates") + data = pluralRegexp.ReplaceAll(data, []byte(plural)) + data = pluralExportedRegexp.ReplaceAll(data, []byte(pluralExported)) + data = singularRegexp.ReplaceAll(data, []byte(singular)) + data = singularExportedRegexp.ReplaceAll(data, []byte(singularExported)) - // plural must be done before singular ("template" is a sub-string of "templates") - data = pluralRegexp.ReplaceAll(data, []byte(plural)) - data = pluralExportedRegexp.ReplaceAll(data, []byte(pluralExported)) - data = singularRegexp.ReplaceAll(data, []byte(singular)) - data = singularExportedRegexp.ReplaceAll(data, []byte(singularExported)) - - err := writeFile("zz_generated_"+strings.ToLower(singularExported)+".go", data) - if err != nil { - return err + generatedFilename := strings.Replace(filename, "template", strings.ToLower(singularExported), 1) + err := writeFile("zz_generated_"+generatedFilename, data) + if err != nil { + return err + } } } diff --git a/vendor/github.com/jim-minter/go-cosmosdb/pkg/gencosmosdb/bindata.go b/vendor/github.com/jim-minter/go-cosmosdb/pkg/gencosmosdb/bindata.go index 1e6ec7c29..499c59937 100644 --- a/vendor/github.com/jim-minter/go-cosmosdb/pkg/gencosmosdb/bindata.go +++ b/vendor/github.com/jim-minter/go-cosmosdb/pkg/gencosmosdb/bindata.go @@ -1,10 +1,12 @@ -// Package gencosmosdb Code generated by go-bindata. (@generated) DO NOT EDIT. -// sources: +// Code generated by go-bindata. (@generated) DO NOT EDIT. + +// Package gencosmosdb generated by go-bindata.// sources: // cosmosdb/collection.go // cosmosdb/cosmosdb.go // cosmosdb/database.go // cosmosdb/document.go // cosmosdb/template.go +// cosmosdb/template_fake.go // cosmosdb/trigger.go package gencosmosdb @@ -102,7 +104,7 @@ func collectionGo() (*asset, error) { return a, nil } -var _cosmosdbGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x57\xdf\x6f\xdc\x36\x12\x7e\x96\xfe\x8a\x89\x00\x1b\x92\x2d\x73\xd7\xbe\x26\x38\x38\xdd\x87\xd4\x76\x5a\x5f\x62\xd7\x67\x6f\xd1\x87\xb4\x68\x68\x69\xb4\xcb\x5a\x22\x15\x92\x72\xbc\x31\xf6\x7f\x3f\x0c\xc9\x5d\x69\xbd\x4e\x10\xdc\x53\x03\x04\xa6\xf8\x63\xf8\xcd\x7c\xdf\xcc\x70\x5b\x5e\xdc\xf1\x19\x42\xa1\x4c\xa3\x4c\x79\x1b\xc7\xa2\x69\x95\xb6\x90\xc6\x51\x72\xbb\xb0\x68\x92\x38\x4a\x0a\x25\x2d\x3e\x58\x37\xd4\x8b\xd6\xaa\xd1\xbc\xe1\xc5\xe0\xd3\xcc\xf9\xd1\xcb\x57\x34\x81\xb2\x50\xa5\x90\xb3\xd1\x2d\x37\xf8\xea\x07\x9a\xaa\x1a\x77\x52\xa8\x91\x50\x9d\x15\x35\x7d\x48\xb4\xa3\xb9\xb5\xed\x6a\x4c\xe6\x5b\xad\xac\x5a\x4d\x74\xda\xed\x33\x56\x17\x4a\xde\x87\xa1\x90\x33\x87\xc7\x8a\x06\x93\x38\x8e\x92\x99\xb0\xf3\xee\x96\x15\xaa\x19\x75\x33\xa5\xff\x16\xa3\x99\x1a\x15\xaa\xc4\x22\x89\xb3\x38\x1e\x8d\xe0\xd7\xd6\x0a\x25\x0d\x68\x6c\x35\x1a\x94\xd6\xc0\x9b\xab\x73\x50\x7e\x3a\xb6\x8b\x16\xd7\x7b\x8c\xd5\x5d\x61\xe1\x31\x8e\x2e\xd5\xd9\x94\xcf\x60\xe3\xdf\xad\x52\x75\x1c\x5d\x69\x9c\x6a\x31\x9b\xa1\x36\xeb\x95\x0f\x7f\x7a\x6c\x71\x74\xa5\x8c\x7d\xba\x3c\x58\xe5\xda\x0a\xba\xea\x1d\x2e\xae\xb9\x9c\xe1\xf9\x29\xac\xd6\x4e\x94\xb4\x42\x76\x9c\x96\x57\x27\xc3\xda\xd2\x39\x72\xa6\xb5\xd2\x43\x37\xb8\x04\xa4\x39\xef\x83\x5f\xee\x3d\xb8\xb1\xdc\x76\xe6\x44\x95\x08\x42\x5a\xb2\x5f\xe2\x86\x59\xf8\xf8\xb7\x51\xf2\x38\xa1\x68\x25\x1f\xe3\xe8\x02\x8d\x21\x25\x6c\x6d\x68\xfc\x42\xf2\x91\x80\x54\x9d\x2c\x20\x45\xd8\x73\xf7\x65\xfe\xda\x34\x5b\x1d\x79\x8c\x23\x8d\xb6\xd3\x12\xaa\xc6\xb2\x9b\x56\x0b\x69\xab\x34\xd9\x29\x61\xc7\x1c\xc3\x8e\x49\x72\x40\xd6\x43\xa3\xaf\xd5\xdf\x70\x7f\x16\xdc\x3d\x37\xce\xf4\xc0\x0d\x6f\xd8\x80\xd5\x1d\x82\xa8\xc8\x79\x10\x06\x54\x05\x83\x00\x70\x59\x82\xb0\x06\xfa\x73\x64\xac\xe1\xb6\x98\x23\x11\xbc\x9e\x75\x8e\x6c\x5d\x92\x92\x51\x17\xd5\x7c\xb0\x99\x22\x98\x39\xfe\xc9\x41\x7f\x75\x0e\xea\x0e\x8e\x27\x34\x64\x69\x88\xc6\x6b\x9a\x7b\x8c\xa3\x55\x0c\x68\x6d\xe0\xc0\x64\x32\x04\x10\x2d\xfb\x58\xf1\xda\x60\x4f\x33\x49\xef\x1a\x3f\x75\x42\x63\x49\x1e\xda\x39\x7a\x4c\x21\x04\x34\x5b\xb9\x59\x27\xd2\x4a\x60\xed\xf6\x49\x65\xa1\x55\x6d\x57\x73\x8b\xa0\x24\x70\xb2\x77\xf5\xdb\x14\x94\x86\xd3\xb3\xf7\x67\xd3\x33\x50\x2d\x6a\x27\xb1\xf8\x9e\xeb\xad\xbb\x26\x8e\x35\xe7\x4b\x95\x26\xce\xb8\xa0\xcc\xf1\xcb\x89\x4f\xa8\x6b\xb4\x7a\xf1\xab\xbc\xd2\x58\x28\x59\x3a\x39\xbf\xe5\xa2\xc6\x92\xd0\x69\x81\x06\x38\x50\x70\x9d\x90\x45\x05\xc2\x42\xc5\x45\x6d\xa0\xec\x10\xac\x72\x98\xb6\xce\x7a\x3a\xbe\x6a\x3a\xad\x9c\xc9\x34\xf3\x71\xc8\xa0\xe7\x29\xa3\x80\x57\x4a\x83\x20\x36\xc6\xaf\x41\xc0\x8f\xf0\xf2\x35\x88\xfd\x7d\x47\x05\x6d\x9c\x40\x95\x66\x71\x44\xcc\xbd\x78\x96\xf2\x1c\xa8\x16\x05\xae\xb6\xaf\x77\x77\xac\x58\x8d\x23\x62\x2e\xa2\x12\xc4\x6e\x6a\xc4\x36\x75\xc3\xd3\xce\x07\x36\x3d\x1c\x8f\xf7\x44\x06\x7b\xe0\xa6\x2f\x44\x5d\x0b\xe3\x0c\x66\x03\xca\xfb\x54\x2a\x60\xaf\xe4\x96\x53\xb5\x3c\xa9\x05\x92\xd0\x78\x67\xe7\x4a\x8b\x2f\x48\xc4\xa0\xb1\xa9\xc6\x4f\xb0\xe7\x10\x86\x99\x1c\x34\x1a\xd5\xe9\x02\xa7\x8b\x16\xfb\xaf\xf7\x42\xde\x85\x54\x74\x98\x4b\x52\xc2\xf1\xc4\x43\xb9\x54\x9f\xd3\x8c\xfd\x36\x3d\x49\x33\xf6\x56\xe9\x86\xdb\x34\xb9\x50\x32\x87\xf1\x11\xfc\x87\x4b\x38\x1a\x8f\x5f\xc1\xe1\xcb\xe3\xf1\x0f\xc7\xe3\x97\xf0\xf3\xc5\x94\x08\x8f\xe6\x74\x9e\xaa\x3d\xbb\xc4\xcf\xa9\xaf\xf3\x34\xcc\xa1\x60\x0d\x37\x16\xf5\x3b\x5c\x64\x71\x44\xca\x79\x1b\xf2\x7d\x9e\x43\xb2\x63\xfe\x90\xc3\xff\x7f\xc8\x24\x0f\xd0\x0c\x9b\xaa\xf7\xea\x33\x6a\x72\x8c\x5d\xa0\x9d\xab\x32\xfb\x96\x4b\xdb\x07\xc9\xb1\x8c\xe0\x91\x85\x5f\x90\x97\xa8\xd9\x0d\xda\x34\x79\x13\x62\xe7\xb8\x48\x72\xe8\x74\xcd\xfe\xdb\xa1\x5e\x9c\x99\x82\xb7\x98\x6e\x94\x25\xaa\x1b\x13\xef\xc4\xee\x3d\xea\xc9\x21\x1b\xef\x1a\x31\x9b\xb8\x3a\xe5\xfb\x17\xbb\xb1\xe5\x59\x68\x69\xcc\x0d\x70\xaa\x6e\x1c\x9a\x74\xce\x6e\xba\x26\x95\xa2\xce\xe8\xdf\x36\x96\x87\x83\xc6\x1c\x10\xd2\x24\x07\x07\xf8\x9b\xac\x97\x2a\x2d\xec\x03\x84\x56\xcb\x4e\xfc\xdf\x1c\x1a\x17\x9f\x1c\x5a\x6e\xe7\xdf\xc1\x7b\x0e\xf8\xd0\x62\x61\xb1\xdc\xec\x00\x39\x08\x99\x83\xea\x2c\x7d\xa0\xae\x78\x81\x8f\xcb\x1c\xe6\x0e\xaf\xf1\xfa\xf7\xe0\x43\x92\x91\x7e\xa8\x48\x68\x34\xed\x5a\x7d\xa6\x55\xd2\xa0\x5f\x58\xa7\x60\xec\x13\x90\xd2\x7f\x11\x92\xd0\x8f\x7f\x74\x1a\x79\xb8\xf6\x75\x21\xcc\x86\xbc\x24\xb3\x39\xf8\xec\x2c\xd8\x5f\xde\xfb\xef\xf7\xf6\x39\x37\xd7\x2e\xae\xdd\xfa\xfe\xa4\x9f\x2a\x75\xc1\xe5\x22\xe4\x97\x09\x19\x7f\xab\x91\xdf\xb9\x84\x8f\xa3\xa8\x60\xb5\x9a\xb1\xdf\xb9\x96\xd4\xd1\x8c\xeb\x68\xdc\x5a\x6c\x5a\x0b\x3b\x65\xe8\x6e\x4f\xf1\x5b\xbd\x70\x5e\x92\x56\xa3\xc6\xb8\xf1\x11\x05\x29\x3c\x6c\xd8\x15\xd7\x06\xcf\x25\x25\xb9\x59\x31\xc0\x7e\x5e\xcb\xc7\x59\x38\xe0\x95\x45\x7d\xd0\x98\x24\xcb\xe1\x70\x9c\xc3\x38\x38\xe6\x8c\xbd\x98\x80\x14\xf5\xb0\x44\xb9\xf9\x15\xec\xaf\x16\xaa\xc6\x7c\xb5\x4a\xb9\x26\xe7\x88\x0f\xc6\x77\x77\xd7\x4a\x19\x5c\x47\xac\xbb\x26\xa8\xe9\x31\xb3\xde\xe1\x90\x94\x58\xa3\xc5\x34\xcc\xe5\x70\x97\x85\xc2\xe9\x0e\xe5\x70\xdf\x9f\x1b\x78\xee\xcf\x86\x43\x1f\xee\xfe\x84\x09\xdc\xfb\x73\xcb\x38\x1e\x78\xf7\xcd\x4c\xfa\xeb\x1f\x94\x4a\xe9\x66\xe6\xe4\x83\xa6\xa5\xf1\x93\x4f\x00\x2a\xb0\xb4\xe9\x12\x3f\x07\xfd\xfd\x2e\xec\x3c\xa0\xde\x4c\x8b\x84\x36\x9a\xe3\xd1\x28\xd9\x2f\xd8\xca\xef\x37\x45\xa1\x3a\x69\xf7\x13\x56\xaa\xa2\x6b\xe8\x71\xc8\xf8\x97\x4e\xa3\x7b\x17\x27\xfb\xde\x5d\xaa\x53\xab\xc7\xcb\x90\xc4\x10\x54\x29\x6a\x87\x66\x4d\xbf\x90\xc3\x5d\xb7\x5d\x45\x38\x77\xdd\x4f\x02\xf6\x53\x57\x55\xa8\x1f\x97\xa1\xbf\x1e\x4f\xc0\xbd\xb9\xc9\x03\x5f\x23\x75\x7a\xdb\x55\xd4\x22\xe8\x09\xf9\x0b\x97\x65\x8d\x59\x28\x9f\xa9\x90\xbd\x7a\x9f\x13\x6f\x8f\xc4\xe9\x85\xaa\xea\x4f\xaa\x5c\xc0\x04\xfc\xcf\x07\x76\xa9\xda\x93\x5a\x19\x7f\x49\x16\xb6\x0c\x0b\xaf\x0b\x9d\xb4\x07\xc4\x6c\x92\x43\xc2\xdb\xb6\x16\x85\x53\xfd\x88\x00\x25\x41\xe4\xdb\x52\x1c\x4a\xb8\xb7\xfa\x61\xfd\xeb\x84\x9d\x70\xa9\xa4\x28\x78\x7d\x71\x7e\x71\xe6\x57\xdf\xe1\x22\xbd\xcb\x82\x54\x97\xcf\xf4\x24\x97\xc8\xf7\xa8\x8d\x6f\x49\xc9\xd1\xf8\xf0\xdf\x07\x87\x47\x07\xff\x3a\x74\x1d\xb6\x60\xcf\x35\xfc\x6f\xe9\xd3\x37\xbe\x55\xfd\xa4\xe8\xb3\x79\xc1\x4e\x15\x9d\xfb\x5e\x8e\xa3\x12\x2b\xd4\xab\x67\xd5\xaa\x22\xbb\x48\xb3\x6b\xe4\x65\xea\xf5\x32\x98\x75\x31\xa7\x77\xd4\x32\x25\x00\xe5\x06\xed\xa7\xe8\x69\x5f\x6f\x7f\x42\x7e\x5f\x52\x86\x2f\xe2\x17\x93\xe7\x52\xec\xb1\x97\xd5\xae\xab\xdb\x4e\x68\xab\xe3\xc3\x12\xb9\x41\x74\x46\x0f\xec\x6d\xae\x43\x39\x62\x1e\x61\xba\xeb\x8a\xb1\x97\xd6\xd3\xf7\xf9\x53\x7c\x7d\xe4\xd6\xd1\x5e\xa7\x07\xa5\x7f\x5f\x1c\xff\x7f\x64\x1b\x17\xf4\x28\x55\x67\xb3\x8d\xa2\xe7\x37\x48\x51\xc7\xcb\xf8\x7f\x01\x00\x00\xff\xff\xaf\x76\x4b\xff\xb5\x0f\x00\x00") +var _cosmosdbGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x57\xd1\x52\xdc\xb8\xd2\xbe\xb6\x9f\xa2\xe3\x2a\x28\x1b\x8c\x66\xe0\xdf\xa4\xfe\x22\x3b\x17\x59\x20\xbb\x9c\x04\x96\x03\xb3\xb5\x17\xd9\xad\x8d\xb0\xdb\x33\x5a\x6c\xc9\x91\x64\xc2\x2c\xc5\xbb\x9f\x6a\x49\x1e\x7b\x80\x50\xa9\x73\x75\x52\x95\x42\x6e\xa9\x5b\x5f\x77\x7f\xdd\xad\x69\x79\x71\xc3\x17\x08\x85\x32\x8d\x32\xe5\x75\x1c\x8b\xa6\x55\xda\x42\x1a\x47\xc9\xf5\xca\xa2\x49\xe2\x28\x29\x94\xb4\x78\x67\xdd\x52\xaf\x5a\xab\x26\xcb\x86\x17\xa3\x4f\xb3\xe4\x07\xaf\xdf\x90\x00\x65\xa1\x4a\x21\x17\x93\x6b\x6e\xf0\xcd\x0f\x24\xaa\x1a\xa7\x29\xd4\x44\xa8\xce\x8a\x9a\x3e\x24\xda\xc9\xd2\xda\xb6\x5f\x93\xf9\x56\x2b\xab\x7a\x41\xa7\xdd\x39\x63\x75\xa1\xe4\x6d\x58\x0a\xb9\x70\x78\xac\x68\x30\x89\xe3\x28\x59\x08\xbb\xec\xae\x59\xa1\x9a\x49\xb7\x50\xfa\x6f\x31\x59\xa8\x49\xa1\x4a\x2c\x92\x38\x8b\xe3\xc9\x04\x7e\x6d\xad\x50\xd2\x80\xc6\x56\xa3\x41\x69\x0d\xbc\xbb\x38\x05\xe5\xc5\xb1\x5d\xb5\xb8\x3e\x63\xac\xee\x0a\x0b\xf7\x71\x74\xae\x4e\xe6\x7c\x01\x1b\xff\xae\x95\xaa\xe3\xe8\x42\xe3\x5c\x8b\xc5\x02\xb5\x59\xef\x7c\xfa\xd3\x63\x8b\xa3\x0b\x65\xec\xe3\xed\xd1\x2e\xd7\x56\xd0\x55\x1f\x70\x75\xc9\xe5\x02\x4f\x8f\xa1\xdf\x3b\x52\xd2\x0a\xd9\x71\xda\xee\x35\xc3\xde\x83\x73\xe4\x44\x6b\xa5\xc7\x6e\x70\x09\x48\x32\xef\x83\xdf\x1e\x3c\xb8\xb2\xdc\x76\xe6\x48\x95\x08\x42\x5a\xb2\x5f\xe2\x86\x59\xf8\xfc\xb7\x51\xf2\x30\xa1\x68\x25\x9f\xe3\xe8\x0c\x8d\x21\x26\x3c\x39\xd0\xf8\x8d\xe4\x33\x01\xa9\x3a\x59\x40\x8a\xb0\xe3\xee\xcb\xfc\xb5\x69\xd6\xab\xdc\xc7\x91\x46\xdb\x69\x09\x55\x63\xd9\x55\xab\x85\xb4\x55\x9a\x6c\x95\xb0\x65\x0e\x61\xcb\x24\x39\x20\x1b\xa0\xd1\x57\xff\x37\xdc\x9f\x05\x77\x4f\x8d\x33\x3d\x72\xc3\x1b\x36\x60\x75\x87\x20\x2a\x72\x1e\x84\x01\x55\xc1\x28\x00\x5c\x96\x20\xac\x81\x41\x8f\x8c\x35\xdc\x16\x4b\xa4\x04\xaf\xa5\xce\x91\x27\x97\xa4\x64\xd4\x45\x35\x1f\x1d\xa6\x08\x66\x2e\xff\xe4\xa0\xbf\x3a\x07\x75\x03\x87\x33\x5a\xb2\x34\x44\xe3\x2d\xc9\xee\xe3\xa8\x8f\x01\xed\x8d\x1c\x98\xcd\xc6\x00\xa2\x87\x21\x56\xbc\x36\x38\xa4\x99\xa8\x77\x89\x5f\x3a\xa1\xb1\x24\x0f\xed\x12\x3d\xa6\x10\x02\x92\x56\x4e\xea\x48\x5a\x09\xac\xdd\x39\xa9\x2c\xb4\xaa\xed\x6a\x6e\x11\x94\x04\x4e\xf6\x2e\x7e\x9b\x83\xd2\x70\x7c\xf2\xf1\x64\x7e\x02\xaa\x45\xed\x28\x16\xdf\x72\xfd\xe4\xae\x99\xcb\x9a\xf3\xa5\x4a\x13\x67\x5c\x50\xe5\xf8\xed\x24\xeb\x01\x9e\x2b\x7b\xda\xb4\x35\x36\x28\xed\x4b\x10\x39\x54\xfc\x06\x81\x42\xed\x68\x1d\x30\x8a\x41\xb7\x87\xf1\xc8\xe2\x26\x90\x47\x3a\x01\xc7\x25\x5a\xbd\xfa\x55\x5e\x68\x2c\x94\x2c\x5d\x59\xbd\xe7\xa2\xc6\x92\x20\x68\x81\x86\xae\x5f\xdf\x5c\x81\xb0\x50\x71\x51\x1b\x28\x3b\x04\xab\x5c\x6c\x9e\xe8\x7a\x5a\x7c\xd3\x74\x5a\x39\x93\x69\xe6\x9d\xcd\x60\xe0\x4b\x46\x89\xaf\x94\x06\x41\xac\x98\xbe\x05\x01\x3f\xc2\xeb\xb7\x20\x76\x77\x1d\x25\xe8\xe0\x0c\xaa\x34\x8b\x23\x62\xd0\xab\x67\xa9\x97\x03\xf5\xc4\xc0\x99\xa7\xd7\xbb\x3b\x7a\x76\xc5\x11\x31\x28\xa2\x56\xc8\xae\x6a\xc4\x36\x75\xcb\xe3\xce\x27\x38\xdd\x9f\x4e\x77\x44\x06\x3b\xe0\xc4\x67\xa2\xae\x85\x71\x06\xb3\x11\xf5\x86\x92\x2e\x60\xa7\xe4\x96\x53\xd7\x3e\xaa\x05\x12\xe1\x79\x67\x97\x4a\x8b\x7f\x90\x08\x82\xc6\xa6\x1a\xbf\xc0\x8e\x43\x18\x24\x39\x68\x34\xaa\xd3\x05\xce\x57\x2d\x0e\x5f\x1f\x85\xbc\x09\x2d\xc1\x61\x2e\x89\x91\x87\x33\x0f\xe5\x5c\x7d\x4d\x33\xf6\xdb\xfc\x28\xcd\xd8\x7b\xa5\x1b\x6e\xd3\xe4\x4c\xc9\x1c\xa6\x07\xf0\x2f\x2e\xe1\x60\x3a\x7d\x03\xfb\xaf\x0f\xa7\x3f\x1c\x4e\x5f\xc3\xcf\x67\x73\x4a\x78\xb4\x24\x7d\x9a\x3a\xec\x1c\xbf\xa6\x7e\xde\xd0\x32\x87\x82\x35\xdc\x58\xd4\x1f\x70\x95\xc5\x11\x11\xe7\x7d\xe8\x3b\xcb\x1c\x92\x2d\xf3\x87\x1c\xff\xff\x43\x26\x79\x80\x66\xd8\x5c\x7d\x54\x5f\x51\x93\x63\xec\x0c\xed\x52\x95\xd9\x4b\x2e\x3d\x55\x24\xc7\x32\x82\x47\x16\x7e\x41\x5e\xa2\x66\x57\x68\xd3\xe4\x5d\x88\x9d\xcb\x45\x92\x43\xa7\x6b\xf6\xef\x0e\xf5\xea\xc4\x14\xbc\xc5\x74\xa3\x3d\x52\xff\x9a\x79\x27\xb6\x6f\x51\xcf\xf6\xd9\x74\xdb\x88\xc5\xcc\xf5\x4b\x3f\x47\xd9\x95\x2d\x4f\xc2\x68\x65\x6e\x81\x73\x75\xe5\xd0\xa4\x4b\x76\xd5\x35\xa9\x14\x75\x46\xff\x9e\x62\xb9\xdb\x6b\xcc\x1e\x21\x4d\x72\x70\x80\x5f\xcc\x7a\xa9\xd2\xc2\xde\x41\x18\xf9\xec\xc8\xff\xcd\xa1\x71\xf1\xc9\xa1\xe5\x76\xf9\x1d\x79\xcf\x01\xef\x5a\x2c\x2c\x96\x9b\x93\x28\x07\x21\x73\x50\x9d\xa5\x0f\xd4\x15\x2f\xf0\xfe\x21\x87\xa5\xc3\x6b\x3c\xff\x3d\xf8\x50\x64\xc4\x1f\xea\x12\x1a\x4d\xbb\x66\x9f\x69\x95\x34\xe8\x37\xd6\x25\x18\xfb\x02\xa4\xf2\x5f\x85\x22\xf4\xeb\x1f\x1d\x47\xee\x2e\x7d\x5f\x08\xd2\x50\x97\x64\x36\x07\x5f\x9d\x05\xfb\xcb\x7b\xff\xfd\xde\x3e\xe7\xe6\xda\xc5\xb5\x5b\xdf\x5f\xf4\x73\xa5\xce\xb8\x5c\x85\xfa\x32\xa1\xe2\xaf\x35\xf2\x1b\x57\xf0\x71\x14\x15\xac\x56\x0b\xf6\x3b\xd7\x92\x26\xab\x71\x93\x95\x5b\x8b\x4d\x6b\x61\xab\x0c\x53\xf6\x31\x7e\xab\x57\xce\x4b\xe2\x6a\xd4\x18\xb7\x3e\xa0\x20\x85\x07\x16\xbb\xe0\xda\xe0\xa9\xa4\x22\x37\x7d\x06\xd8\xcf\x6b\xfa\x38\x0b\x7b\xbc\xb2\xa8\xf7\x1a\x93\x64\x39\xec\x4f\x73\x98\x06\xc7\x9c\xb1\x57\x33\x90\xa2\x1e\xb7\x28\x27\xef\x61\x7f\xb3\x51\x35\xe6\x9b\x5d\xca\x0d\x5b\x97\xf8\x60\x7c\x7b\x7b\xcd\x94\xd1\x75\x94\x75\x37\x8c\x35\x3d\xaa\xd6\x27\x1c\x92\x12\x6b\xb4\x98\x06\x59\x0e\x37\x59\x68\x9c\x4e\x29\x87\xdb\x41\x6f\xe4\xb9\xd7\x0d\x4a\x9f\x6e\xfe\x84\x19\xdc\x7a\xbd\x87\x38\x1e\x79\xf7\x62\x25\xfd\xf5\x3f\x54\x4a\xe9\x66\xe5\xe4\xa3\xa1\xa5\xf1\x8b\x2f\x00\x6a\xb0\x74\xe8\x1c\xbf\x06\xfe\xfd\x2e\xec\x32\xa0\xde\x2c\x8b\x84\x0e\x9a\xc3\xc9\x24\xd9\x2d\x58\xef\xf7\xbb\xa2\x50\x9d\xb4\xbb\x09\x2b\x55\xd1\xd1\xb0\x36\x8c\xff\xd3\x69\x74\xef\xf3\x64\xd7\xbb\x4b\x7d\xaa\x7f\x44\x8d\x93\x18\x82\x2a\x45\xed\xd0\xac\xd3\x2f\xe4\xf8\xd4\x75\x57\x11\xce\x6d\xf7\xd3\x84\xfd\xd4\x55\x15\xea\xfb\x87\x30\x5f\x0f\x67\xe0\xde\xfe\xe4\x81\xef\x91\x3a\xbd\xee\x2a\x1a\x11\xf4\x94\xfd\x85\xcb\xb2\xc6\x2c\xb4\xcf\x54\xc8\x81\xbd\xcf\x91\x77\x40\xe2\xf8\x42\x5d\xf5\x27\x55\xae\x60\x06\xfe\x67\x0c\x3b\x57\xed\x51\xad\x8c\xbf\x24\x0b\x47\xc6\x8d\xd7\x85\x4e\xda\x3d\xca\x6c\x92\x43\xc2\xdb\xb6\x16\x85\x63\xfd\x84\x00\x25\x81\xe4\x4f\xa9\x38\xa6\xf0\x60\xf5\xd3\xfa\x57\x12\x3b\xe2\x52\x49\x51\xf0\xfa\xec\xf4\xec\xc4\xef\x7e\xc0\x55\x7a\x93\x05\xaa\x3e\x3c\x33\x93\x5c\x21\xdf\xa2\x36\x7e\x24\x25\x07\xd3\xfd\xff\xdf\xdb\x3f\xd8\xfb\xbf\x7d\x37\x61\x0b\xf6\xdc\xc0\x7f\x89\x9f\x7e\xf0\xf5\xfd\x93\xa2\xcf\x96\x05\x3b\x56\xa4\xf7\xbd\x39\x8e\x4a\xac\x50\xf7\xcf\xaa\xbe\x23\xbb\x48\xb3\x4b\xe4\x65\xea\xf9\x32\x92\xba\x98\xd3\x3b\xea\x21\x25\x00\xe5\x46\xda\x8f\xd1\xa7\x7d\x7d\xfc\x51\xf2\x87\x96\x32\x7e\x99\xbf\x9a\x3d\x57\x62\xf7\x03\xad\xb6\x5d\xdf\x76\x44\xeb\xd5\xc7\x2d\x72\x23\xd1\x19\x3d\xf4\x9f\xe6\x3a\xb4\x23\xe6\x11\xa6\xdb\xae\x19\x7b\x6a\x3d\xfe\x9d\xf0\x18\xdf\x10\xb9\x75\xb4\xd7\xe5\x41\xe5\x3f\x34\xc7\xff\x1e\xd9\xc6\x05\x03\x4a\xd5\xd9\x6c\xa3\xe9\xf9\x03\x52\xd4\xf1\x43\xfc\x9f\x00\x00\x00\xff\xff\x92\x66\x43\x3c\x3d\x10\x00\x00") func cosmosdbGoBytes() ([]byte, error) { return bindataRead( @@ -162,7 +164,7 @@ func documentGo() (*asset, error) { return a, nil } -var _templateGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x58\x4f\x6f\xdb\xb8\x12\x3f\x8b\x9f\x82\xd5\xc1\xb0\x62\x59\x7e\xef\x6a\xc0\x0f\x28\x92\xbc\xae\xb7\x9b\xb4\x9b\xe6\xb0\xc0\x62\x81\x30\xd2\xd8\x61\x23\x8b\x2a\x45\x35\x09\x0c\x7f\xf7\x05\xa9\x3f\x26\x29\x4a\x76\xba\x69\x91\xae\x2f\xb6\xa5\xe1\xcc\x8f\xf3\x9b\x19\xce\x30\x27\xf1\x3d\x59\x03\x8e\x59\xb1\x61\x45\x72\x8b\x10\xdd\xe4\x8c\x0b\x3c\x46\x9e\x1f\xb3\x4c\xc0\xa3\xf0\x91\xe7\x67\x20\x66\x77\x42\xe4\xf2\x77\x21\x78\xcc\xb2\xaf\xf5\x4f\x9a\xad\x0b\x1f\x21\x2f\xbf\x5f\x63\x7f\x4d\xc5\x5d\x79\x1b\xc5\x6c\x33\xfb\x4c\x37\xd3\x0d\xcd\x04\xf0\xd9\x9a\x4d\x1b\xfd\xb3\xfc\x7e\x3d\x5b\x43\xd6\xfe\x6f\x7f\x24\xe5\x66\xf3\xe4\xa3\x00\x21\xf1\x94\x03\x16\xb0\xc9\x53\x22\xe0\x34\xa5\x90\x09\x5c\x08\x5e\xc6\x02\x6f\x91\x77\x92\x10\x41\x6e\x49\x51\xbf\x41\x5e\x4e\xc4\x1d\xae\x80\xa0\x1d\x42\xb3\x19\xbe\x36\xd7\xd2\x02\x93\x56\x1f\x8e\xab\x65\xca\x88\x2d\x28\xd1\xae\x48\x0c\xd2\xce\x29\x07\x22\x60\x5c\xfb\x20\x3a\xad\xbe\xc3\xda\x52\x88\x4f\xf2\xfb\x75\xd4\x28\x08\xf1\xc9\x87\x5c\x50\x96\x15\x01\x1e\x5b\x6f\x80\x73\xc6\x03\xe4\xfd\x46\x0b\x31\xde\x8b\x35\x02\x57\xe4\x61\x29\x80\x13\xc1\x78\x25\xf3\x36\x4d\xbb\x56\xfb\xd4\x17\x7b\xfd\xef\x40\xf4\xa3\x6d\x51\x1f\x84\x79\x05\x79\x4a\xe2\x97\xdc\xf8\x19\xa4\xf0\x4d\x9e\x54\x0a\x90\xf7\x7b\x09\xfc\x69\xdc\x4a\xab\xbf\xba\x98\xd3\x93\x4a\xca\xe9\xca\x7e\x45\xbd\xae\x3d\xbd\x23\xd9\x1a\xfe\x0f\x90\x38\x08\x6c\x6d\xee\xec\xd0\x6d\x57\x35\x22\x7a\x18\x9b\x01\x8e\x3c\x89\x93\x66\x25\x91\xda\x9b\x70\xf6\x58\x65\x0c\xab\x4f\x63\xba\x63\x48\x46\xcd\x37\x9b\x48\x58\x06\xb8\xf9\xdc\x32\x96\x1e\x6b\x55\xb9\xef\x18\xb3\x39\xe1\x82\x4a\x1d\xf7\xf0\xd4\x9a\xfd\x22\x57\x37\x66\x2b\x2a\x5e\x00\xa0\x96\xfc\x2d\x32\x33\xfd\x69\xc3\x96\x51\x00\xf6\xc2\x7a\x09\xb8\x84\x47\x47\x4a\xd1\x4c\x0c\x85\x8a\xb6\x85\x71\xe0\xae\x4b\x5a\xa0\x5a\xe8\x38\x79\xe8\x41\x68\xac\xd1\x41\x76\xc2\x50\xc1\xbe\x22\x0f\x4e\xe4\xe1\x7e\xf1\x76\xd7\x64\x58\x85\xee\x12\x1e\xac\x7a\xc8\x41\x94\x3c\x93\x00\x33\x78\xe8\x54\xd0\x55\x99\xc5\xdd\x45\xe3\x98\xa5\x69\x8c\x4f\x59\x9a\x42\x2c\x9d\x50\x3d\x0e\xb1\x7c\x4e\x93\xda\x21\x81\x5d\x7a\xb7\xc8\xab\xac\xe1\x91\x19\x3e\x5b\xe4\x79\x66\xc5\x9f\x2b\x55\x71\x34\x3e\x89\x2d\x23\x41\x64\x4a\x86\xc8\x53\xa7\xc3\x1c\xef\x3f\xfd\x6b\xd5\x39\x32\xc1\xfe\x4c\xbe\x2a\x66\x3e\x9e\xd4\x98\x43\xe4\xed\xa4\x8f\xd4\x86\xc7\x31\xb6\x02\x3c\xc0\x44\x96\x19\xf1\x88\xbb\x0e\xef\x04\x58\x6f\xe4\x48\x0f\x90\x34\x6d\x54\x17\x78\xbe\xc0\x23\x43\x72\xbb\x43\xc8\x5b\x31\x2e\x25\x3d\x61\xac\x97\xc2\x34\xaa\xc2\x55\x3c\x86\x78\xfa\xdf\x00\x79\x1e\x5d\xa9\x77\x6f\x16\x38\xa3\xa9\x5a\xd5\xf8\x38\xa3\xa9\x5a\x87\x3c\x6f\x57\x09\xee\xed\x2e\x34\xf1\x5b\x0e\xe4\x5e\x09\x21\xcf\x40\x17\x9d\xb2\x32\x13\x78\xb2\xc0\xd6\x23\x5b\xee\x0a\x0a\x56\xf2\x18\x96\x67\x58\x97\xdd\x3f\xb6\x17\x5c\xef\x81\x60\x92\xe7\x90\x25\x63\xf7\xfb\x10\x3b\x1e\x46\x51\x14\x20\x05\xb7\xde\xa9\xbe\x36\x94\x1b\x1b\x24\xb2\x39\xf3\x5d\x5c\x3a\xaa\x58\x28\xf3\xa2\x4d\x0b\xeb\x18\x6b\x6a\x94\x76\xbc\xf4\x89\x4a\x96\xf6\x51\x70\x07\x24\x01\xae\x02\x40\x76\x5c\xd1\x2f\xea\xff\x76\xd7\xbe\x89\x3e\x81\x18\xfb\x7f\x4c\x2f\x8a\xe9\x19\x8b\xcb\x0d\x64\x22\xb9\x9d\x7e\xd4\xf0\xf9\x21\xbe\xf9\xd3\xbf\x99\xe8\x98\x27\x37\xfe\x5f\x37\x01\x42\x92\xed\x06\x9b\xc6\x75\xfb\x08\x8f\x6a\xc0\xd2\xe2\xae\xad\xb5\xd1\x25\x3b\xbf\x26\x6b\xc9\x22\x2f\x01\x21\x4f\x82\x5e\xe0\x38\x2a\x40\xd4\x0b\xc6\xb5\xa8\xe1\x96\x10\xd7\xa8\x03\xe4\x08\xc8\x8a\xa5\x8a\xb1\x46\x61\xc2\xaa\x20\x56\x9b\xbf\x00\x71\xc7\x92\x8f\xac\x90\x15\x44\xa5\xe8\xc4\x9f\x25\x2c\x2e\xfc\x10\xfb\xf5\x77\xf5\xbc\x5e\xf0\x49\x10\x51\x16\x15\x91\x49\x88\x47\x06\x94\x91\x0b\x55\x8d\x61\x28\x2e\x54\xeb\xd6\x25\xd4\x55\x9b\xb7\xd6\x29\x36\x5f\x60\xdf\x37\x9c\xae\x6d\xdf\x90\x5c\x34\x12\x91\x7e\x86\x18\xd1\x3c\x72\x9d\xf8\x5b\x13\xed\x1c\xc7\x6d\xf0\xcd\x71\x4b\x89\x6e\x6a\x6e\xfc\x1b\xae\x6d\x6d\x47\xea\xca\x09\x47\x8c\xf7\x57\xb7\x7a\x0f\x71\x54\x97\x4b\x49\x9c\xee\xd8\x20\x18\x04\xa2\xda\xdb\x43\x89\xb9\x2f\x0a\xed\x51\xf3\x8a\x33\x71\x30\x85\x64\x89\x7e\x81\xd4\x79\x07\x76\xe6\xcc\xfc\xc9\xde\x49\x76\x16\xb9\x65\xb4\xcc\xfa\xf0\xbe\xc6\xf6\xad\xb9\xd4\xce\x17\xff\xea\x22\xfb\x43\xab\x63\xe9\xa0\x58\x33\x12\x2d\xcf\xfa\x69\xb6\xe5\x2c\xaa\x5f\xa6\x7e\x36\x13\xe0\xd1\x94\x3f\x83\xef\xd7\xc3\xeb\x8b\x92\x5a\xb9\xac\x3f\x2d\x07\x49\xed\x63\xf4\x92\x29\xb7\xcb\x76\x5c\xe5\xb0\x55\x64\x8e\x60\xb2\x9a\xc5\x9d\x9c\x55\x13\x5d\x33\x55\xbf\xa6\xd3\xd2\x98\x54\x5d\xc7\xa5\xbe\x9f\xb9\x75\xa0\xa8\x6d\xcd\xab\xaf\x97\x3c\x58\xf7\x17\x14\x47\x67\xc5\x21\x0f\x3f\xf3\xf0\xed\x72\x19\x5a\xdb\x3c\x70\x24\x6b\xd7\x22\xfd\x74\xff\x60\xae\xbb\x97\x2e\xdf\xb7\x3f\xea\x16\x82\xd6\x07\xfd\x65\xac\xa9\x52\x5a\x89\xaa\x67\x71\xb9\x79\x77\x83\xbe\x1f\xdd\xaa\x8d\x6b\x43\x5b\xe3\xb8\xd1\x08\xbf\xb1\xda\xf5\xad\x39\xde\x45\x55\x0f\x2f\x3d\x6f\x0c\x84\xe7\x9c\xcb\x37\x57\xf0\xa5\xa4\x1c\x92\x7a\x2e\x34\x4a\xe6\x72\x35\xbd\x20\x22\xbe\xf3\x43\x53\x9b\x9a\xb7\xa4\x8d\x14\xb2\xc6\x05\xd1\x47\x0e\xd7\x9c\xae\xd7\xb2\xae\xe0\xff\xe1\xff\x28\x63\xc3\x15\x98\xc3\xb4\x5e\x32\x5d\x66\x71\x5a\x26\xe0\x37\x77\x75\x45\xf4\x2b\xa3\x4e\xe5\x21\xf6\x43\x3f\x70\x43\x60\x85\x78\x2e\x06\x56\x88\xa3\x41\x68\xea\x87\x50\x34\xd9\xf5\x1e\x9e\xae\x64\x64\x2e\xcf\x8e\x05\xd3\x5d\xe9\xb7\x81\xeb\xd4\x6b\x24\x84\x31\xea\x52\x2d\x6e\x3b\xf9\x11\xe0\xe6\xe2\xa0\x5b\x86\x36\xe4\x71\x29\x60\x53\x4d\xfb\xd5\xc5\xd7\xfe\xa6\xc0\x51\x6d\x9e\x7f\x12\xbf\x9d\x2e\x2f\xe4\x2c\xb7\xcc\x62\x0e\x72\xeb\x24\xc5\x2b\x80\xc4\x97\xa7\x6d\xd7\x41\x17\xe4\x71\x2a\x11\x4d\x15\xa4\x8a\x9c\x98\x65\x5f\xa3\xa5\x60\x64\xac\xc3\x0d\xaa\xd3\x97\x46\x46\x29\x79\xd3\x86\xbe\x1d\xdc\x97\x2c\x83\x36\xc2\xcd\x55\x81\x7e\x5a\x53\xfd\xec\xa7\xd1\x3f\x69\xd8\x69\x6f\xc3\x4e\x7b\x46\x5d\xda\x1d\x75\xbb\x0d\x79\x61\xe1\x58\x16\xe7\x92\x95\x7a\x32\x66\x09\xc8\x9e\xc9\xea\x0b\xc4\x05\x4b\xe8\x8a\x42\xa2\xb8\xab\xf1\xd5\xb5\xe6\xc0\x5e\x2c\x0f\x2f\x1a\xe3\x91\x9c\xd8\xfc\x73\x41\xd6\x8a\x4b\xbb\xb9\x38\x10\x93\xce\x7b\x54\xed\x24\x33\xad\x3a\xd5\xea\x43\xf2\x77\x0a\xf2\x86\xc7\xf6\xca\x55\x92\xa9\xeb\xd3\x69\x71\x74\x58\x83\x68\x6b\x85\x87\x01\x87\xd5\xbd\xb1\x7e\xb1\x6b\xb5\xc5\x2a\x11\xd4\x45\xba\xcd\xde\x73\x1a\xe6\xef\x94\x7c\x4a\xb7\xce\xf7\xcf\x9a\x80\x9c\x3c\x1c\x8f\x60\x38\x6d\xba\x3e\x91\x0a\x2b\x0a\x17\xb6\x5f\xd5\x79\x3e\x9c\x62\x66\x74\xbd\x40\x72\x19\x3d\xf5\xeb\xcf\x2e\x07\xdc\x9f\x3c\xbd\x06\x9b\x87\x65\xa1\x1a\x79\x19\xb8\xd7\xbc\x04\xdf\x96\xaf\xc7\xc0\xe9\xf5\x53\x2e\x3b\x1c\x9f\xe4\x79\x4a\x63\xc5\xf6\x4c\xad\x9c\x7c\x2e\xea\x98\x5b\xa9\x98\xd7\xa6\x91\xa1\x2c\x3e\x30\x52\x9b\x9a\xea\xa1\xda\xdb\x61\x48\x0b\x38\xac\x51\x71\x38\x3d\xcf\xc8\x6d\x0a\x31\x67\x45\xd1\x2a\xd3\xf7\xb9\xfb\x79\x2b\x4f\x75\xcd\xfd\xcc\xd2\x33\xa2\x51\x3d\xb4\xbd\xe6\xfa\x63\xe5\xdf\xb3\x0b\xd0\xdf\x01\x00\x00\xff\xff\x0a\x30\xe5\xc2\xa8\x22\x00\x00") +var _templateGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x59\x5b\x6f\xdb\x38\x16\x7e\x16\x7f\x05\xab\x07\xc3\x8a\x65\x79\xf7\xd5\x80\x17\x28\x92\x6c\xd7\xdb\x49\xda\x49\xf3\x30\xc0\x60\x80\x30\xd2\xb1\xc3\x46\x16\x55\x8a\x6a\x12\x18\xfe\xef\x03\x92\xba\x90\x94\x64\x27\x99\xa4\x93\x69\x5e\x62\x4b\xe7\xf2\xf1\xdc\x0f\x9d\x93\xf8\x96\xac\x01\xc7\xac\xd8\xb0\x22\xb9\x46\x88\x6e\x72\xc6\x05\x1e\x23\xcf\x8f\x59\x26\xe0\x5e\xf8\xc8\xf3\x33\x10\xb3\x1b\x21\x72\xf9\xb9\x10\x3c\x66\xd9\xf7\xea\x23\xcd\xd6\x85\x8f\x90\x97\xdf\xae\xb1\xbf\xa6\xe2\xa6\xbc\x8e\x62\xb6\x99\x7d\xa5\x9b\xe9\x86\x66\x02\xf8\x6c\xcd\xa6\xb5\xfc\x59\x7e\xbb\x9e\xad\x21\x6b\xbe\x37\x1f\x92\x72\xb3\x79\xf0\x51\x80\x90\x78\xc8\x01\x0b\xd8\xe4\x29\x11\x70\x9c\x52\xc8\x04\x2e\x04\x2f\x63\x81\xb7\xc8\x3b\x4a\x88\x20\xd7\xa4\xa8\xde\x20\x2f\x27\xe2\x06\x6b\x20\x68\x87\xd0\x6c\x86\x2f\x6d\x5e\x5a\x60\xd2\xc8\xc3\xb1\x66\x53\x4a\x5c\x42\x89\x76\x45\x62\x90\x7a\x8e\x39\x10\x01\xe3\xca\x06\xd1\xb1\xfe\x1f\x56\x9a\x42\x7c\x94\xdf\xae\xa3\x5a\x40\x88\x8f\x3e\xe5\x82\xb2\xac\x08\xf0\xd8\x79\x03\x9c\x33\x1e\x20\xef\x17\x5a\x88\x71\x4b\x56\x13\x2c\x05\x70\x22\x18\xd7\x04\xef\xd3\xb4\xab\x72\x48\x76\xd1\x0a\xff\x00\x62\x18\x6a\x03\xf9\x20\xc6\x0b\xc8\x53\x12\xbf\xe4\xa9\x4f\x20\x85\x67\x99\x51\x09\x40\xde\xaf\x25\xf0\x87\x71\x43\xad\xbe\x9a\x64\x35\xeb\x05\xb9\x6b\x2d\xa9\xa8\x7a\x4d\x39\x2c\x68\xd0\xb4\xc7\x37\x24\x5b\xc3\x7f\x01\x92\x7d\xde\xdb\xb9\x71\xdb\x70\xd5\x24\x66\x0c\xdb\xd1\x8d\x3c\x89\x93\x66\x25\x91\xd2\xeb\x58\xf6\x98\x56\x86\xd5\x5f\xad\xba\xa3\x48\x46\xcd\xb3\x55\x24\x2c\x03\x5c\xff\x5d\x33\x96\x3e\x56\xab\x32\xdf\x63\xd4\xe6\x84\x0b\x2a\x65\xdc\xc2\x43\xa3\xf6\x9b\xe4\xae\xd5\x6a\x57\xbc\x00\x40\x23\xf3\x1b\x64\x76\xee\xd3\xda\x5b\x56\xf6\xb7\xc4\x66\xfe\x9f\xc3\x7d\x4f\x4a\xd1\x4c\xec\x0b\x15\xe3\x08\xe3\xa0\xbf\x28\x19\x81\xea\xa0\xe3\xe4\x6e\x00\xa1\xc5\x63\x82\xec\x16\x11\x09\xfb\x82\xdc\xf5\x22\x0f\x5b\xe6\xed\xae\xce\x30\x8d\xee\x1c\xee\x9c\x62\xc8\x41\x94\x3c\x93\x00\x33\xb8\xeb\x94\xcf\x55\x99\xc5\x5d\xa6\x71\xcc\xd2\x34\xc6\xc7\x2c\x4d\x21\x96\x46\xd0\x8f\x43\x2c\x9f\xd3\xa4\x32\x48\xe0\xd6\xdd\x2d\xf2\xb4\x36\x3c\xb2\xc3\x67\x8b\x3c\xcf\x2e\xf7\x73\x25\x2a\x8e\xc6\x47\xb1\xa3\x24\x88\x6c\xca\x10\x79\xaa\x35\xcc\x71\xfb\x37\xcc\xab\x9a\xc8\x04\xfb\x33\xf9\xaa\x98\xf9\x78\x52\x61\x0e\x91\xb7\x93\x36\x52\x07\x1e\xc7\xd8\x09\xf0\x00\x13\x59\x66\xc4\x3d\xee\x1a\xbc\x13\x60\x83\x91\x23\x2d\x40\xd2\xb4\x16\x5d\xe0\xf9\x02\x8f\x2c\xca\xed\x0e\x21\x6f\xc5\xb8\xa4\xf4\x84\xc5\x2f\x89\x69\xa4\xc3\x55\xdc\x87\x78\xfa\xef\x00\x79\x1e\x5d\xa9\x77\xef\x16\x38\xa3\xa9\xe2\xaa\x6d\x9c\xd1\x54\xf1\x21\xcf\xdb\x69\xc2\x56\xef\xc2\x20\xbf\xe6\x40\x6e\x15\x11\xf2\x2c\x74\xd1\x31\x2b\x33\x81\x27\x0b\xec\x3c\x72\xe9\x2e\xa0\x60\x25\x8f\x61\x79\x82\x4d\xda\xf6\xb1\xcb\x70\xd9\x02\xc1\x24\xcf\x21\x4b\xc6\xfd\xef\x43\xdc\xf3\x30\x8a\xa2\x00\x29\xb8\xd5\x49\x4d\xde\x50\x1e\x6c\xaf\x23\xeb\x86\xdf\xe7\xcb\x9e\x2a\x16\xca\xbc\x68\xd2\xc2\x69\x63\x75\x8d\x32\xda\xcb\x10\xa9\xf4\x52\x1b\x05\x37\x40\x12\xe0\x2a\x00\xe4\xb8\x15\xfd\x4f\x7d\xdf\xee\x9a\x37\xd1\x17\x10\x63\xff\xb7\xe9\x59\x31\x3d\x61\x71\xb9\x81\x4c\x24\xd7\xd3\xcf\x06\x3e\x3f\xc4\x57\xbf\xfb\x57\x13\x13\xf3\xe4\xca\xff\xe3\x2a\x40\x48\x7a\xbb\xc6\x66\xf8\xba\x79\x84\x47\x15\x60\xa9\x71\xd7\xd4\xda\xe8\x9c\x9d\x5e\x92\xb5\xf4\x22\x2f\x01\x21\x4f\x82\x5e\xe0\x38\x2a\x40\x54\x0c\xe3\x8a\xd4\x32\x4b\x88\x2b\xd4\x01\xea\x09\x48\xed\x25\xed\xb1\x5a\x60\xc2\x74\x10\xab\xc3\x9f\x81\xb8\x61\xc9\x67\x56\xc8\x0a\xa2\x52\x74\xe2\xcf\x12\x16\x17\x7e\x88\xfd\xea\xbf\x7e\x5e\x31\x7c\x11\x44\x94\x85\x76\x64\x12\xe2\x91\x05\x65\xd4\x87\xaa\xc2\xb0\x2f\x2e\xd4\xdc\xd6\x75\x68\xa7\x7b\x6c\x9d\x16\x36\x5f\x60\xdf\xb7\x2c\x6e\x9c\xdd\xa2\x5c\xd4\x14\x91\xd9\x40\xac\x50\x1e\xf5\xb5\xfb\xad\x0d\x75\x8e\xe3\x26\xf2\xe6\xb8\xf1\x87\xa9\x6a\x6e\x7d\xdb\x5f\xd8\x9a\x71\xb4\x2f\x21\x7a\x02\x7c\xb8\xb4\x55\x67\x88\xa3\xaa\x56\x4a\xaf\x99\x56\x0d\x82\xbd\x40\xd4\x6c\x7b\x28\x2b\xdb\x8a\xd0\xf4\x99\x37\x9c\x86\x7b\xf3\x47\xd6\xe7\x17\xc8\x9b\x0f\xe0\xa6\xcd\xcc\x9f\xb4\x46\x72\x53\xa8\x9f\xc6\x48\xab\x4f\x1f\x2b\x6c\xcf\x4d\xa4\x66\xb9\xf8\xa9\x2b\xec\x0f\x2d\x8d\x65\x8f\x8b\x0d\x25\xd1\xf2\x64\xd8\xcd\x2e\x9d\xe3\xea\x97\x29\x9e\xf5\xfa\xf7\x68\x97\x3f\xc1\xdf\x6f\xc7\xaf\x2f\xea\x54\x6d\xb2\xe1\xb4\xdc\xeb\xd4\x21\x8f\x9e\x33\x65\x76\x39\x8b\xab\x1c\x76\x8a\xcc\x23\x3c\xa9\x17\xf1\x5e\x9f\xe9\x75\xae\x5e\xa9\x87\x5b\xa5\xb9\xc6\xfc\x98\x6e\x69\xad\xa9\x7d\xed\xd2\x3c\xcf\xdc\x69\x28\xea\x58\x73\xfd\xef\x25\x1b\x6b\x7b\x3b\xf1\xe8\xac\x38\x64\xe1\x27\x36\xdf\xae\x2f\x43\xe7\x98\x07\x5a\xb2\x71\x27\xf2\x66\x26\xa3\xee\x8d\xcb\xeb\xce\x47\xdd\x42\xd0\xd8\x60\xb8\x8c\xd5\x55\xca\x28\x51\xd5\x22\x2e\x0f\xdf\x3f\x9d\xb7\x7b\x9b\x3e\xb8\xb1\xb1\xd5\x86\x1b\x8d\xf0\x3b\x67\x56\xdf\xda\xbb\x5d\xa4\x07\x78\x69\x79\x6b\x1b\x3c\xe5\x5c\xbe\xb9\x80\x6f\x25\xe5\x90\x54\x4b\xa1\x55\x32\x97\xab\xe9\x19\x11\xf1\x8d\x1f\xda\xd2\xd4\xb2\x25\x75\xa4\x90\xd5\x26\x88\x3e\x73\xb8\xe4\x74\xbd\x96\x75\x05\xff\x07\xff\x4b\x29\xdb\x5f\x81\x39\x4c\x2b\x96\xe9\x32\x8b\xd3\x32\x01\xbf\xbe\xa8\x2b\xa2\xff\x33\xda\x2b\x3c\xc4\x7e\xe8\x07\xfd\x10\x58\x21\x9e\x8a\x81\x15\xe2\xd1\x20\x0c\xf1\xfb\x50\xd4\xd9\xf5\x11\x1e\x2e\x64\x64\x2e\x4f\x1e\x0b\xa6\xcb\xe9\x37\x81\xdb\x2b\xd7\x4a\x08\x6b\xcf\xa5\x46\xdc\x76\xf2\x23\xc0\xf5\xad\x41\xb7\x0c\x6d\xc8\xfd\x52\xc0\x46\xaf\xfa\xfa\xd6\xab\xbd\x26\xe8\xa9\x36\x4f\xef\xc4\xef\xa7\xcb\x33\xb9\xc8\x2d\xb3\x98\x83\x3c\x3a\x49\xf1\x0a\x20\xf1\x65\xb7\xed\x1a\xe8\x8c\xdc\x4f\x25\xa2\xa9\x82\xa4\x9d\x13\xb3\xec\x7b\xb4\x14\x8c\x8c\x4d\xb8\x81\xee\xbe\x34\xb2\x4a\xc9\xbb\x26\xf4\xdd\xe0\x3e\x67\x19\x34\x11\x6e\x73\x05\x66\xb7\xa6\x66\xef\xa7\xd1\x5f\x19\xd8\xe9\xe0\xc0\x4e\x07\xf6\x5c\xda\xdd\x73\xbb\x03\x79\xe1\xe0\x58\x16\xa7\xd2\x2b\xd5\x5a\xcc\x12\x90\x33\x93\x33\x17\x88\x33\x96\xd0\x15\x85\x44\xf9\xae\xc2\x57\xd5\x9a\x03\x67\x71\x2c\xbc\xa8\x95\x47\x72\x63\xf3\x4f\x05\x59\x2b\x5f\xba\xc3\xc5\x81\x98\xec\xbd\x44\x35\x3a\x99\xad\xb5\x57\xac\xb9\x24\xbf\x52\x90\xab\x00\x53\xb7\xd3\xae\x55\x9e\x32\x88\xbe\x52\x50\x2b\xd9\xa6\x1d\x7f\xb6\xc0\x7e\x76\x50\x76\x2d\x23\x05\x6a\x47\x2e\x5c\xeb\xaa\x6e\xb9\x3f\x80\xed\x48\x7b\x81\xd0\xb5\x26\xd6\x57\x8a\xdd\xda\x55\xcd\x6f\x05\xd2\x5f\xa6\x3c\xd3\xf2\x3d\xdb\xc1\x7e\xb8\x95\xc4\xc3\x88\x43\xfd\x8b\x87\xf9\x93\xc4\xf8\xef\x4f\xb2\xbd\xad\x79\x59\xa8\x31\x59\x86\xef\x25\x2f\xc1\x77\xe9\xab\x25\x6b\x7a\xf9\x90\xcb\xf9\xc1\x27\x79\x9e\xd2\x58\x79\x7b\xa6\x38\x27\x5f\x8b\x2a\xe6\x56\x2a\xf2\x8d\x59\x7f\x5f\x2e\x1f\x58\x58\x6d\x49\xd5\xca\xea\xed\x30\xa4\x05\x1c\x96\xa8\x7c\x38\x3d\xcd\xc8\x75\x0a\x31\x67\x45\xd1\x08\x33\xcf\xb9\xfb\xe7\xd6\x1f\x7d\x83\xfc\xc4\x02\x34\xa2\x51\xb5\x12\x8d\x38\xb9\x7b\xab\xf5\xc7\xc9\xbf\x27\x17\xa0\x3f\x03\x00\x00\xff\xff\xd9\x5c\x1a\xfb\x00\x22\x00\x00") func templateGoBytes() ([]byte, error) { return bindataRead( @@ -182,6 +184,26 @@ func templateGo() (*asset, error) { return a, nil } +var _template_fakeGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x59\x5b\x6f\xe4\xb6\x15\x7e\x96\x7e\xc5\xc9\x00\x35\x24\x67\x56\x93\xbc\x3a\x98\x00\xa9\x77\x37\xdd\x36\x71\x5b\xef\x16\x7d\x30\x8c\x05\x47\x3a\x9a\xe1\x8e\x44\x2a\x24\xe5\xf1\xc0\x98\xff\x5e\x90\xd4\x85\xba\xcd\x65\xe3\xa0\xad\x1f\x3c\x92\x48\x9e\xfb\xf9\xce\x21\x59\x90\x78\x4b\xd6\x08\x31\x97\x39\x97\xc9\xca\xf7\x69\x5e\x70\xa1\x20\xf0\xbd\x59\xcc\x99\xc2\x67\x35\xf3\xbd\x59\x9a\x9b\x1f\x86\x6a\xb1\x51\xaa\xd0\xcf\x72\xcf\xe2\x99\xef\x7b\xb3\x35\x55\x9b\x72\x15\xc5\x3c\x5f\x94\x6b\x2e\xbe\xd0\xc5\x9a\x2f\x62\x9e\xa0\x19\x2e\xb6\x6b\x70\xa7\x7c\xa1\xf9\x9b\x9c\x32\x85\x62\xb1\xe6\x6f\x6a\xbe\x8b\x62\xbb\x5e\xac\x91\x35\xef\xcd\x43\x52\xe6\xf9\x7e\xe6\x87\xbe\xaf\xf6\x05\x42\x4a\xb6\xf8\x09\xf3\x22\x23\x0a\x3f\x09\xba\x5e\xa3\xf8\x0b\x61\x49\x86\x02\xd2\x92\xc5\x41\x25\x73\x74\x6b\x7f\xe7\x70\x5d\x6c\xd7\x51\xbd\x22\x04\x14\x82\x8b\x21\xa9\x7f\x96\x28\xf6\x1d\x42\xf5\xc8\x6d\x46\x91\x69\x3a\x66\xca\x1c\xae\xff\x5e\x28\xca\x99\x0c\xa1\x9e\x71\x4f\x76\x1f\x14\x0a\xa2\xb8\xf0\xfd\x27\x22\xe0\x33\x74\x17\xc3\x12\xae\xde\x3b\xcc\xec\xd7\x97\x83\xef\x2f\x16\x70\x87\xbb\xe1\x18\x08\x54\xa5\x60\x12\x08\x0c\x07\x7d\x2d\xdf\xf8\xba\x60\x03\xd7\xc6\xf2\xd1\x5f\x25\x67\x56\x9f\x10\xae\x47\x18\xbc\xf8\x9e\xe5\x31\x2a\x9a\xef\x79\xaa\xfa\x22\x6f\xc0\xfe\xe5\x64\x8b\x41\x4e\x8a\x07\xa9\x04\x65\xeb\xc7\x87\xc7\xd5\x5e\x61\x38\xd7\x73\x3b\x8e\x90\x37\x83\xb9\xd3\x5e\x33\xeb\x7f\x73\xac\x6f\xf8\x1d\x5b\xef\xba\xca\xac\xfe\xd2\xa8\x5a\x89\xba\xd1\x5f\x33\x1e\x6f\x6b\xd1\xcd\xdf\x95\x0e\xd8\xe8\xfe\xdf\xbf\x96\x0a\x9f\x5f\x0e\x73\xdf\x3b\xf8\xd6\x05\x23\xe6\xa1\x13\xa6\x37\x81\x33\x32\x5f\x2a\x51\xc6\xc6\xaa\x8d\xdd\x1a\xb3\xf5\x2c\xe6\x3b\x02\xdb\x29\x03\x97\xf9\x46\x7a\x57\xf8\x6b\x57\x78\xbf\x6f\x70\x38\xcb\xd4\x7e\xd7\xce\x5d\xd9\xa6\x2c\xec\x7b\x92\x0b\x85\xa2\x15\xc5\x64\xc7\xc3\x63\x37\xaf\x7c\xdf\x5b\x2c\x9a\xa8\x55\xa2\x44\xa0\x29\x24\x3c\x2e\x73\x64\x4a\x42\xcc\x59\x9a\xd1\x58\xf9\x5e\xfd\x74\xbb\xc1\x78\x5b\x27\x5b\x87\xd8\x20\x67\x57\x9c\x67\x96\x01\x0a\x31\xd7\x84\x19\x57\xc0\x68\x36\x37\x7e\x62\x36\xa9\x41\xf1\x4a\x00\xd8\x6d\x90\x01\x51\xda\x15\x8a\xb2\xb5\x1e\x89\x79\x9e\x97\x8c\xc6\x44\x3b\x60\xb1\x80\x1d\x55\x1b\x50\x1b\x2a\xa1\xf2\xac\x87\x42\x54\xe8\x70\xf0\x6d\x8a\x05\xf1\x58\xea\x84\x90\xa0\x76\x58\xfd\x35\x90\x50\xa5\x02\x04\xb5\xf3\xa1\xa7\x50\x43\x3b\xd4\x21\xa2\xdf\x96\x60\x9d\x7e\x87\xbb\xb7\x86\x9c\xf8\xf3\x5e\xa1\x0c\xe4\x1c\xe2\xa8\x0d\x90\x30\xb2\xa3\xc1\x95\x6a\x4c\x5d\x25\xee\x49\x31\x35\x9a\x3a\x62\x8e\xcb\x16\x42\xb0\xaa\xe4\x3f\x21\xe6\x3b\xe6\x88\x79\xb5\xea\xcb\x69\x87\x83\x51\x31\x17\x0b\xf8\x88\xea\x9d\xf1\x92\x44\x25\x81\x0b\x28\x99\x79\x6a\xbd\xb7\x21\x0a\x76\x34\xcb\x60\x85\x95\x1f\x31\x01\xce\x80\xb0\xfd\x44\x92\xe6\xa8\x36\x3c\x01\xca\x9e\x78\x4c\x34\x28\x1f\xb7\x47\x2d\x42\xd0\x55\x33\x8e\x74\xb2\x45\xbf\xf0\x78\x1b\x84\xbe\x97\x60\x8a\x02\xaa\x8f\xff\x62\x99\xfd\xac\xa7\x59\x7b\xa0\x10\xad\x4a\x1f\x6d\x6e\xf4\x75\x82\x2a\x67\xb4\x38\x5a\x2e\xd8\x6d\x68\xbc\x69\xb4\x2b\x25\x26\x3a\x26\xf5\x2c\x78\x22\x59\x89\xd2\x6f\xb2\x07\x13\x58\xed\xe1\x17\x2a\x55\x10\x42\xaa\x0d\x83\x52\xe3\x0b\x59\xd1\x8c\xaa\xfd\x49\x15\xad\x48\x81\x23\xc1\x20\x59\x2f\x53\xbb\xa2\xb4\xac\x94\x6a\x95\xbf\xed\x65\xf2\xc0\x0a\x3d\xf5\x63\xc2\x5c\xed\x9f\x48\x46\x13\x9d\x8e\x8b\x05\x90\x24\xa1\x7a\x26\xc9\xa0\x64\xf4\xb7\x12\x61\x8b\x7b\x09\x94\x01\x69\x6a\xe9\x49\xcd\x7b\xf2\x04\x5f\x89\x34\x97\x59\xa7\xcf\x64\x09\xbd\x2f\xad\xbd\x7a\xed\xca\xc0\x5c\x15\xa8\xc3\xa6\x42\xde\x53\xfa\x76\xe9\x05\xd5\xf2\x3b\x92\x23\x58\x50\x9f\x37\x24\x8f\xd4\xdf\x8b\xb4\xed\xd5\x9d\x07\x87\xe7\x23\x2c\x6b\x76\xad\xca\x9d\xb6\x6a\xa0\xb0\x29\x47\x67\xab\xeb\xd2\x0a\xcc\xd2\x8e\xaa\x96\xd8\x64\xa3\x70\x91\x9a\x9d\x3a\xf9\xd0\xf0\xd2\x2a\x9a\x97\x33\x2a\x04\x16\xb7\xbc\xd8\x4f\x83\xee\xb0\x40\x54\x70\xb4\xb2\x30\x7c\xb3\x84\x38\x9a\x40\xf0\xd0\xf7\x68\x6a\x66\x7d\xb3\xd4\x65\x50\x2f\xab\xbb\x39\x53\x15\x35\x46\x79\x07\xbf\x69\xf1\xe2\xa8\x57\xb2\x56\xe1\x49\x15\x48\x51\x64\xfb\x20\x56\xcf\x30\x68\xa9\x0b\x22\x94\x49\xd7\x2d\xee\xdb\x50\x9b\x28\x7d\xdc\xb6\xcb\x4d\xdf\xac\x6b\xf6\xad\x40\x3d\xd3\x66\xdb\xb4\x29\xce\xf4\x17\x4d\xc1\x82\xf3\x84\x35\xcc\xa0\xb5\x87\xea\x54\x64\x63\xe3\x81\xab\x42\x58\x2c\x20\xe6\xc5\x1e\x18\xdf\xc1\x0a\x63\x52\x4a\x84\x42\x60\x15\xdd\xd2\x00\x59\x5e\x2a\xad\x42\xbd\xe8\x6c\x8f\xd0\xb4\xb1\x88\x33\xb5\x91\xa6\x10\x3c\x46\x29\xff\x21\xea\x34\x95\xda\x05\xad\x75\x1b\x7b\x86\xbe\x37\xc2\x72\xc8\xd3\x3b\x58\xbe\x9f\xe7\x80\xcf\x54\x2a\x69\xf9\x34\x5d\xea\x43\xfd\x14\x7d\x78\xfb\x68\xc4\x6b\xdc\x73\x75\x55\x2f\xe9\x6b\x73\x65\xea\xa8\x61\xf8\x51\x11\x55\xca\x5b\x9e\xe0\x0d\xe8\x9d\x61\x54\x7f\xb0\x20\xa8\x3b\x71\xef\x57\x94\x92\xac\x6d\x77\x3e\x7b\xc7\x14\x55\xfb\xba\xff\x42\x90\x05\xc6\x34\xa5\x98\x00\x4d\x80\x64\x02\x49\xb2\xaf\xf9\x52\x66\xa7\xec\xa5\xc2\x7c\x36\xaf\xb5\xd1\x52\x7e\xe3\x8a\xf9\xcd\x71\x39\x27\x64\xbc\xe3\xea\x3d\x2f\x59\x72\x68\x3c\x33\x84\x73\xc7\xb6\xba\x16\xd3\x44\x9b\x4f\x10\xa6\xb7\xcc\xad\x11\xad\xed\xeb\xd7\x4f\xdc\xac\xee\xc4\x58\x27\xfb\x5c\xf3\xd3\xe4\x51\xbb\x72\xcc\x97\x23\xce\x34\x82\x7a\xa3\xa2\x06\x03\xf6\x6d\x40\x0f\xc9\x39\x1e\x3c\xcf\x87\xaf\xea\x45\xe3\x47\xfb\xaf\x32\xfe\xab\xa2\xde\x54\x78\xc3\x12\x56\x2d\x28\xb6\x29\xc5\x68\x56\x95\xac\x2a\xa4\x62\xf3\x23\x9d\xe6\xa3\x56\x22\x21\x8a\xac\x88\x3c\xd1\x8c\x58\x32\x7f\x00\x78\x1e\x43\xcb\x06\xeb\x1b\xe4\xee\x32\x1b\x01\x91\xb9\xd9\xa9\x85\x95\xf2\xf7\x58\x64\x24\xd6\xcd\xb7\xf9\xfd\x7a\xf5\x2b\x42\xff\x0f\xfa\xa7\x24\x93\x8d\x01\x74\xd3\xed\x9c\xbc\xd4\x4c\xea\xc3\x1d\xdd\xb4\x66\x7a\x0a\xc9\xb2\x66\x50\x5e\x66\x1a\xd3\xd7\x0f\x8f\x90\x1a\x16\x6d\xd5\xbb\x1f\x2d\x7b\xf7\xe7\xd5\xbd\xde\xe1\x90\x49\x76\xca\xd6\xce\x49\x55\x60\x96\x86\xdd\xb2\x68\x8a\x83\x39\x7b\xe9\x6d\x19\xe6\xf0\xdd\x1c\x32\x64\x2e\x74\x85\xa1\x6f\x30\xf1\xf3\x1c\x8e\xa0\xa2\x98\x86\xc1\xe4\x78\x0d\x3b\x43\x07\xab\x81\xc1\x91\x96\xeb\x52\xb7\x2e\xc8\x92\x06\x38\xe4\x1c\x6a\x45\x8d\xc9\xaa\x0d\x8d\xc3\xb2\xfe\xd6\x2e\x09\x3b\xfd\x53\x4f\x94\x86\xbf\xc3\xe1\x3b\x37\x88\x7e\xca\x32\x13\x29\xf2\xf7\x86\xca\x4f\x59\x36\x9e\x45\xa7\x12\x43\xba\x99\x41\xb5\xba\xc6\x03\x26\xfc\xda\x0e\xa2\x52\x4f\x8f\x47\x77\xf8\xac\x6c\xd2\xbc\xf9\xbe\xd6\xe5\x67\x54\xb0\xb6\xbd\x7a\x83\x04\xa9\xe0\xf9\x05\x5a\xfc\x8c\xea\x02\x1c\xa0\x49\xf3\x78\x49\xea\xbf\x46\xca\x1c\x69\x15\x47\xfb\x26\x9a\xd8\x76\xe9\x55\x7a\x8f\xa9\x3e\xbd\xad\x7d\xd6\x21\x6f\x31\x43\x85\x90\x98\x9f\xdf\xe3\x16\x4b\xe8\x84\x67\xfe\xf6\x55\x08\x6d\x8f\x73\x5e\xa5\x7d\x77\xdc\x71\x7e\xff\x3a\xe2\x90\x8b\x7c\x91\x54\xa6\x89\x9c\xec\x76\x98\xb4\x69\xe3\xb4\x0d\x1b\x8d\x7d\xef\x51\xb7\x3f\x12\x4a\x46\xf3\x22\xc3\x1c\x99\xc2\xe4\x44\xa3\xd0\x2c\xfc\xdf\x2b\x0a\xe7\xaf\x7a\x27\xc4\x1d\x57\x1f\x5a\xa5\x4f\xef\x2e\xc7\xf7\x39\xc3\x58\xfc\x8a\xb0\xab\x6a\x92\x7b\x1c\xd2\x54\xa7\x6a\x59\xe4\xf0\x35\x16\xa2\x29\x74\x8f\x36\xaa\x28\x3b\x72\xdc\xf1\x43\x7f\x85\x5b\xc2\xaa\x92\xd7\x9d\xd1\xdd\xc9\x9d\xea\xfa\x9b\x86\xdf\xf3\x0e\x80\x99\xc4\x4e\x71\x1c\x98\xbc\x6d\xa5\x07\xd1\x69\xce\x41\x20\x26\x59\x36\x38\x74\xd1\x2d\x4d\x13\xac\x0d\x74\xd8\x39\x94\xad\x8f\xfb\xd0\xd0\x0d\xd8\xf0\x10\xa6\xbe\x2a\x1b\x3a\x69\xe4\xca\xec\xbf\x14\xdd\x34\x05\xf7\x94\xc7\xfa\x7b\xe4\xdc\x27\x32\xba\x3c\xfe\xd0\x9d\x3d\x64\xef\x0e\x07\x71\x65\x09\x77\xb7\xfe\x1a\x29\x55\x3b\x53\xf7\x17\x7f\x90\x3f\x27\x3b\x8e\xd1\x7a\x7d\xca\xdf\x67\x35\x25\x36\x8e\x66\xb3\x11\xa3\x1d\x6d\x50\xc6\xae\x41\x87\xad\x19\x0c\x5a\x59\xad\x1a\x65\xa5\xb9\x31\x00\xaa\x35\x9f\x08\xcb\xba\x7a\xa4\x23\x0c\x5e\x9c\xfb\x51\xa7\x50\xb8\xb4\x6f\x3a\x6f\xe6\xb2\x71\x70\xef\xdc\xb0\x9b\xb8\x40\xec\x09\x6f\xae\xcf\x3a\xc2\xfb\x5e\xc2\x19\x36\x97\x73\xe6\xaa\xac\x01\x5f\x0a\xd7\x63\xcc\x42\xd0\xb6\xbc\x27\xbb\x71\x4f\xe7\xe4\xf9\x83\xc2\xfc\x96\x97\x4c\x69\x16\x73\xe0\xa5\x79\x40\x91\x92\x18\x5f\x0e\x0e\xd8\x4e\xc2\xd1\x79\x32\x9c\x27\xc0\xf1\x38\x4a\x81\x46\xc6\x06\xfd\x0e\x4c\x23\xa0\x49\xbb\x27\x22\x60\x32\x1e\x0c\x85\x0e\xc7\xe5\x12\xde\x7c\x0f\x2f\xbd\x4d\x05\x75\x7b\xbf\xa8\xe3\xe7\x47\x5d\x41\x3a\x9f\x60\x69\x76\x4b\xce\x1a\xb3\xd7\xb1\x72\x2e\xcd\xae\xdb\x77\x61\x3d\x27\xcf\x3a\x17\x7a\x44\xbe\xed\xc8\x65\xcb\x94\x9e\xf9\xe3\x80\xb8\xad\x0d\x7a\x6c\x94\x71\x7f\x83\x74\x44\x97\x9c\x3c\x8f\xa8\xf3\xad\xde\x16\x3e\xbb\x2a\x50\xe3\xae\x7a\x42\x10\x6a\xab\xcd\x66\x1d\x98\xbb\xea\xf8\x4c\x4b\xf8\x69\x2c\x67\x7c\xcf\x33\xfa\xd9\xcb\x7a\x2d\x7d\x2b\xfb\xdc\xf7\x0e\xcd\xf9\xcc\x89\x78\xea\xc9\x63\x21\xaa\x89\x90\x8e\x3a\x3f\x0e\xad\xe4\x46\x8f\xd5\xa3\x7e\x4b\x73\x15\x7d\x2c\x04\x65\x2a\x0d\x66\x7f\x4a\x66\xf3\x1e\xb5\x1a\x99\x4f\xa3\xfa\xc8\xd9\x82\x3b\x6a\x6e\xc9\x34\xa5\xdd\x86\x4b\xac\x6e\x37\x65\x7d\xa7\xad\x7b\xfb\x35\x7d\xc2\xea\xbe\x74\x14\xfd\x26\xf6\xc8\x75\xb6\x5c\x00\x73\x23\x94\x5e\x50\x88\x1b\x4d\x6a\x1c\xc9\xc6\xf4\x6d\x41\x6d\xe4\x72\xbd\xe7\xc8\x91\xf5\xaf\x86\x11\x2e\x2a\xd0\xa8\xba\xc1\xbd\x4c\x0a\x83\x96\x7d\x21\x0c\x38\x1e\x05\xc6\xaf\xe0\x36\x19\xc7\x6d\x74\x1e\xfc\xff\x04\x00\x00\xff\xff\x54\x67\x80\x34\xb8\x25\x00\x00") + +func template_fakeGoBytes() ([]byte, error) { + return bindataRead( + _template_fakeGo, + "template_fake.go", + ) +} + +func template_fakeGo() (*asset, error) { + bytes, err := template_fakeGoBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "template_fake.go", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + var _triggerGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x57\x4f\x6f\xdb\x36\x14\x3f\x8b\x9f\x82\xe5\xa1\xb0\x6a\x55\xbe\x07\xd0\x21\x73\x8a\x2c\xd8\x92\x16\x49\x0e\x03\x86\xa1\x65\xa8\x67\x87\xab\x2c\x6a\x24\x8d\x24\x30\xf2\xdd\x07\x92\xa2\x44\x4a\xb4\x97\xa2\x87\xf9\x90\xc8\x8f\xef\xef\xef\xf7\xde\xa3\xdc\x51\xf6\x9d\x6e\x01\x33\xa1\x76\x42\xd5\x0f\x08\xf1\x5d\x27\xa4\xc6\x0b\x94\x11\x26\x5a\x0d\xcf\x9a\xa0\x8c\xb4\xa0\x57\x8f\x5a\x77\x04\xe5\x08\xad\x56\xf8\x5e\xf2\xed\x16\x24\x96\xd0\x49\x50\xd0\x6a\x85\x29\xd6\x4e\x88\xf4\x4b\x07\x83\x86\xd2\x72\xcf\x34\x3e\xa0\xec\xea\x02\xc7\x1f\xa5\x25\x6f\xb7\x81\xe0\xdb\xdf\x4a\xb4\x67\x84\xd7\x85\xd8\x71\x0d\xbb\x4e\xbf\x90\x6f\x28\xbb\x05\x25\xf6\x92\xc1\xe0\xe0\x98\xe1\x57\x39\x35\xbd\xe7\x3b\x50\x9a\xee\x3a\xaf\xc9\x5b\x1d\x27\xe1\x4d\xb5\x8a\x2d\xef\xa0\xd9\xbc\x29\xdb\xaf\x0a\x9a\x4d\x6c\xfb\xe9\x9e\x6e\xdf\x66\x0b\x9a\x6e\x63\xdb\x5f\x44\xfd\xf2\x26\xdb\x07\x51\xbf\x4c\x8a\x75\x90\x7f\xee\x40\x52\xcd\x45\x8b\x67\x82\xde\x54\x4f\xe4\x49\x37\xf7\x86\x45\xfb\x99\x09\x62\x37\x46\x1e\x79\x78\x0d\x5b\x64\x0c\x9e\xea\x15\x2c\xfc\x71\xd4\x35\xa3\x91\xab\x3e\xed\x90\x89\x56\x69\xda\x6a\x85\xec\x93\xe9\xd9\xa9\xce\x79\xd3\x84\x25\x8c\xb6\x15\x26\xe7\x4d\x43\xe6\x16\x6b\x09\x54\x43\xda\xc2\x9d\x25\x8c\x6e\xa1\x6b\x28\x4b\xa4\x5f\x61\xd2\x9f\x25\xac\x2e\xa0\x81\x63\xa1\xdc\xd9\x64\xdc\x2c\x03\x49\x18\x0d\x78\x11\x82\x56\x75\x0e\x9e\x15\x1f\xc7\xcd\x1c\x7f\x91\x10\x53\x5e\x61\xf2\x45\x06\xf9\x5b\x25\xa1\xf4\x4c\x49\x28\x3d\x49\x58\x85\xd9\xf6\xb9\xaa\x28\x4f\x15\x2c\x88\xb5\xd8\xfb\xe9\x0c\xc6\xd4\x8f\x0a\x33\xa7\x47\x17\x43\x30\x25\xc7\x97\x81\x0f\x89\xf1\x9f\x7f\x7d\xf0\x0b\xaa\x57\xf7\x87\xd3\x4e\xb6\xc9\xf6\xa9\xaf\x1b\x0e\xad\x0e\x32\xfe\x50\x53\x4d\x1f\xa8\x02\x77\x82\xb2\x8e\xea\x47\x0f\x7b\x34\x06\xbd\x29\x0f\x49\x63\xce\x28\x84\xc3\xab\xb5\x1a\xe4\xc6\x74\x94\x81\xc5\x76\xdd\xa2\xdf\xc6\xe5\xda\xfd\x2f\xb0\xaf\x20\xc7\x0b\xff\x58\x60\x90\x52\xc8\x1c\x65\xbf\x73\xa5\x17\xb9\x77\x7b\xa5\x4d\x6b\x09\xe9\xe4\xe7\x4d\x33\xf5\x16\xf8\x50\xa3\x93\x4b\xd0\xf3\xb0\xae\xba\x64\x50\xd7\xb4\xa7\x32\xb5\x9a\x86\x38\x3b\x13\x3f\x56\xd3\x84\x0c\x53\x89\xaf\x2b\xa4\x24\xe2\x0a\x65\x26\x04\x6f\xf7\xd1\x36\xc9\x6a\xd1\xc2\xb0\x4f\x1f\x84\x68\x62\xb2\x06\xb7\x11\x5d\xdc\x83\x18\x12\x36\xaa\x86\x94\xdd\xc0\xf3\x0c\xb9\x24\xc4\x2e\xec\x0d\x3c\xc5\xfc\x4b\xd0\x7b\xd9\x9a\xe0\x2d\x3c\x4d\xfb\x65\xb3\x6f\xd9\xcc\x64\xc1\x44\xd3\x30\xbc\x16\x4d\x03\xcc\xee\x31\x2b\x2e\xb0\x91\xf3\x7a\x60\x2d\x8e\x73\x40\x99\x0b\x85\xdf\x47\xb0\x1d\x50\x96\xc5\xad\x7d\x66\x1d\xb1\x72\xf1\x81\x4d\x42\xe4\x65\xac\x59\xa0\xcc\x8e\xc1\x59\x70\x65\x1d\xb7\xb5\x03\xb3\xc4\x64\x65\x8e\xd4\x8a\xe0\x65\x9f\x71\x81\xb2\x57\x03\x8f\xad\x76\xc1\x70\xcc\x6b\x8e\xa9\x69\x62\xfd\x8c\x67\x2d\xc4\xa7\xd4\xa4\x80\x37\x95\xd3\xa6\xf1\x2b\x09\x9f\x55\xf8\xbd\xd7\x39\xbc\x22\x94\x6d\x84\x34\x3a\x99\x0e\x0d\x8d\x1a\x2f\x1d\xb9\xfa\x39\x47\x59\xc6\x37\x56\xfe\xae\xc2\x2d\x6f\xac\x81\x07\xb4\xe5\x8d\xb5\x41\x59\xf6\xea\x14\x87\x60\x55\xa0\xfd\x20\x81\x7e\xb7\x3a\x28\x0b\x33\x2a\xdd\x32\x5c\x56\x38\x96\x4c\xb4\x82\x0d\x18\x68\x8e\xd2\x89\xfa\xb0\x01\x2b\x4c\xbb\x0e\xda\x7a\x91\x3a\x2d\xf0\x4c\x54\x96\x65\x8e\x6c\x92\x7d\x79\x81\x5d\x61\xaa\x39\x45\x95\x5f\x60\x29\xb6\x5a\x78\xf2\xed\x1d\xcc\xfe\x54\xe4\xd0\x1f\xa9\x33\xdf\x2a\xcc\xca\x5a\x18\xaf\x05\x36\xaf\xa6\xe5\x35\xe8\x47\x51\x9b\x5b\xa8\xc0\xcc\x36\xd6\x92\xac\x7c\x92\xa4\xc0\x24\x78\x76\xe7\xbd\xe1\x9d\xa6\x7a\xaf\x5c\x96\x75\x81\xdf\x8f\x39\x15\xc3\x5c\xd8\x22\x73\x5f\xfe\xa9\x6a\xd3\x9b\x37\x31\x6a\xe1\x02\x3b\x44\x4e\xce\x30\x3b\xd9\xfb\xc3\x12\x9f\x23\x7a\xac\xd9\xfb\xd8\xac\xec\xe7\xc6\x40\xe0\x32\xcd\x4f\x45\xb2\x37\x40\x8a\xb7\x5e\x2f\xd8\x2c\x3f\x43\xda\x25\xa4\x38\x5b\x91\xe5\x10\x26\x45\xdf\x51\xd5\x80\xd5\xcf\xbf\x15\x6e\x14\x7f\x9c\x48\x7f\x9b\x9d\x28\x7f\x7a\xb3\x99\x32\xc7\x49\x2f\xed\xef\x80\xaa\xc2\x84\xd8\x61\xef\x39\xf8\x24\xa5\x39\xb8\x85\x7f\xf6\x5c\x42\x6d\xc6\x2a\x7b\x04\x5a\xf7\x7b\xc8\x26\xff\xab\xfd\x7e\x18\x4f\xca\x3b\xd0\x0b\x72\xb5\xf9\x78\x4d\x35\x7b\x24\x45\x14\x23\x0f\xf8\x4d\xa0\xeb\x0a\x39\x89\x5a\x79\x75\xf1\x66\x84\xad\x6e\x00\xf1\x8d\xb0\xb0\x98\xcb\xc6\x22\x6d\xff\xf4\x69\x9f\x6c\xae\xe1\x2d\xe0\xff\x5c\x0c\x2b\xb2\x1c\x43\xbd\x09\x86\x89\xfa\x4f\xaf\x10\x3e\x00\x13\x6e\x84\x1c\xfb\x7b\x26\x31\xe2\xc3\x55\x12\xcf\x7a\x00\x04\xdf\x60\x5e\xda\xd7\x9c\xb1\xf3\xdc\x02\x3f\xde\x6a\xd6\x26\x7a\x5f\x7a\x37\xf4\x6e\xd4\x86\x7f\x7c\xbc\x56\x1f\xd7\x81\x22\x29\x26\x96\xfd\x65\xe1\xe8\xe0\x47\x47\x9e\xff\xc7\x9a\xe6\xf3\x35\x3d\x1b\x68\x15\x34\x5b\xe2\x3e\x0e\x4b\x9f\x54\x57\x79\xc3\xf2\x32\x5d\x95\x71\xe8\x40\xac\xa6\xc8\xd8\xa9\x46\x01\x99\xff\x06\x00\x00\xff\xff\xd4\x0c\x52\x6d\x4a\x11\x00\x00") func triggerGoBytes() ([]byte, error) { @@ -206,8 +228,8 @@ func triggerGo() (*asset, error) { // It returns an error if the asset could not be found or // could not be loaded. func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) @@ -232,8 +254,8 @@ func MustAsset(name string) []byte { // It returns an error if the asset could not be found or // could not be loaded. func AssetInfo(name string) (os.FileInfo, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) @@ -254,12 +276,13 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ - "collection.go": collectionGo, - "cosmosdb.go": cosmosdbGo, - "database.go": databaseGo, - "document.go": documentGo, - "template.go": templateGo, - "trigger.go": triggerGo, + "collection.go": collectionGo, + "cosmosdb.go": cosmosdbGo, + "database.go": databaseGo, + "document.go": documentGo, + "template.go": templateGo, + "template_fake.go": template_fakeGo, + "trigger.go": triggerGo, } // AssetDir returns the file names below a certain @@ -273,13 +296,13 @@ var _bindata = map[string]func() (*asset, error){ // b.png // then AssetDir("data") would return []string{"foo.txt", "img"} // AssetDir("data/img") would return []string{"a.png", "b.png"} -// AssetDir("foo.txt") and AssetDir("notexist") would return an error +// AssetDir("foo.txt") and AssetDir("nonexistent") would return an error // AssetDir("") will return []string{"data"}. func AssetDir(name string) ([]string, error) { node := _bintree if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") + canonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(canonicalName, "/") for _, p := range pathList { node = node.Children[p] if node == nil { @@ -303,12 +326,13 @@ type bintree struct { } var _bintree = &bintree{nil, map[string]*bintree{ - "collection.go": &bintree{collectionGo, map[string]*bintree{}}, - "cosmosdb.go": &bintree{cosmosdbGo, map[string]*bintree{}}, - "database.go": &bintree{databaseGo, map[string]*bintree{}}, - "document.go": &bintree{documentGo, map[string]*bintree{}}, - "template.go": &bintree{templateGo, map[string]*bintree{}}, - "trigger.go": &bintree{triggerGo, map[string]*bintree{}}, + "collection.go": &bintree{collectionGo, map[string]*bintree{}}, + "cosmosdb.go": &bintree{cosmosdbGo, map[string]*bintree{}}, + "database.go": &bintree{databaseGo, map[string]*bintree{}}, + "document.go": &bintree{documentGo, map[string]*bintree{}}, + "template.go": &bintree{templateGo, map[string]*bintree{}}, + "template_fake.go": &bintree{template_fakeGo, map[string]*bintree{}}, + "trigger.go": &bintree{triggerGo, map[string]*bintree{}}, }} // RestoreAsset restores an asset under the given directory @@ -354,6 +378,6 @@ func RestoreAssets(dir, name string) error { } func _filePath(dir, name string) string { - cannonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) + canonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) }