From d912890e665d808fe1a1547466026e1c2f491b9a Mon Sep 17 00:00:00 2001 From: hunterlong Date: Wed, 3 Apr 2019 08:12:44 -0700 Subject: [PATCH] GraphQL - sample data boolean on setup --- Gopkg.lock | 324 ++++++++ Gopkg.toml | 94 +++ handlers/graphql/generated.go | 1292 ++++++++++++++++++++++++++++++- handlers/graphql/gqlgen.yml | 4 + handlers/graphql/resolver.go | 56 +- handlers/graphql/schema.graphql | 30 + handlers/setup.go | 7 +- version.txt | 2 +- 8 files changed, 1764 insertions(+), 45 deletions(-) create mode 100644 Gopkg.lock create mode 100644 Gopkg.toml diff --git a/Gopkg.lock b/Gopkg.lock new file mode 100644 index 00000000..4f498bd9 --- /dev/null +++ b/Gopkg.lock @@ -0,0 +1,324 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + digest = "1:7ea2faecf1d650c855ee70f55b934cc2265404625b7114e048ac7d6a64c23b41" + name = "github.com/99designs/gqlgen" + packages = [ + "complexity", + "graphql", + "graphql/introspection", + "handler", + ] + pruneopts = "UT" + revision = "010a79b66f08732cb70d133dcab297a8ee895572" + version = "v0.8.3" + +[[projects]] + digest = "1:07f7314344b2771963ada0b2a4a426c59d782dac227dcfff2499188a186446c0" + name = "github.com/GeertJohan/go.rice" + packages = [ + ".", + "embedded", + ] + pruneopts = "UT" + revision = "cd53cd147dd5288bc2fb990fb983e58e301abb5e" + version = "v1.0.0" + +[[projects]] + digest = "1:786e862ec180708b60ee670723e3edd969fd4309e7b1c315cd7de058ac62a011" + name = "github.com/agnivade/levenshtein" + packages = ["."] + pruneopts = "UT" + revision = "51b298ff305e72cfd29166dccc3f9878e82f9fdc" + version = "v1.0.2" + +[[projects]] + digest = "1:f1ec92a2b8473612547f6e13edbc8c8e6cda6c8be9c54b31958aad4a7ccaaa2b" + name = "github.com/ararog/timeago" + packages = ["."] + pruneopts = "UT" + revision = "518814407569bf983ea81e1bf8b550dd4e7b34f3" + version = "0.0.1" + +[[projects]] + digest = "1:86b9f9c54fcddec313009ef19073bf0124bbdae3701080c32f67c0c8817b3b7c" + name = "github.com/daaku/go.zipexe" + packages = ["."] + pruneopts = "UT" + revision = "db7cf2ba330f8c2d28b827826e33d6628ea7e9e0" + version = "v1.0.0" + +[[projects]] + digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec" + name = "github.com/davecgh/go-spew" + packages = ["spew"] + pruneopts = "UT" + revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" + version = "v1.1.1" + +[[projects]] + digest = "1:3806f369b846160fcbde19bdcf93790868defe7c58d1bb6bc8d974c5b8f8dc1e" + name = "github.com/go-mail/mail" + packages = ["."] + pruneopts = "UT" + revision = "f59b9b83a4e522098e3d3eb94e6f81850ad6e973" + version = "v2.3.1" + +[[projects]] + digest = "1:ec6f9bf5e274c833c911923c9193867f3f18788c461f76f05f62bb1510e0ae65" + name = "github.com/go-sql-driver/mysql" + packages = ["."] + pruneopts = "UT" + revision = "72cd26f257d44c1114970e19afddcd812016007e" + version = "v1.4.1" + +[[projects]] + digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96" + name = "github.com/go-yaml/yaml" + packages = ["."] + pruneopts = "UT" + revision = "51d6538a90f86fe93ac480b35f37b2be17fef232" + version = "v2.2.2" + +[[projects]] + digest = "1:c79fb010be38a59d657c48c6ba1d003a8aa651fa56b579d959d74573b7dff8e1" + name = "github.com/gorilla/context" + packages = ["."] + pruneopts = "UT" + revision = "08b5f424b9271eedf6f9f0ce86cb9396ed337a42" + version = "v1.1.1" + +[[projects]] + digest = "1:ca59b1175189b3f0e9f1793d2c350114be36eaabbe5b9f554b35edee1de50aea" + name = "github.com/gorilla/mux" + packages = ["."] + pruneopts = "UT" + revision = "a7962380ca08b5a188038c69871b8d3fbdf31e89" + version = "v1.7.0" + +[[projects]] + digest = "1:e72d1ebb8d395cf9f346fd9cbc652e5ae222dd85e0ac842dc57f175abed6d195" + name = "github.com/gorilla/securecookie" + packages = ["."] + pruneopts = "UT" + revision = "e59506cc896acb7f7bf732d4fdf5e25f7ccd8983" + version = "v1.1.1" + +[[projects]] + digest = "1:e5bf52fd66a2e984b57b4c0f2c4ee024ed749a19886246240629998dc0cf31ce" + name = "github.com/gorilla/sessions" + packages = ["."] + pruneopts = "UT" + revision = "f57b7e2d29c6211d16ffa52a0998272f75799030" + version = "v1.1.3" + +[[projects]] + digest = "1:7b5c6e2eeaa9ae5907c391a91c132abfd5c9e8a784a341b5625e750c67e6825d" + name = "github.com/gorilla/websocket" + packages = ["."] + pruneopts = "UT" + revision = "66b9c49e59c6c48f0ffce28c2d8b8a5678502c6d" + version = "v1.4.0" + +[[projects]] + digest = "1:7fbb40f65374cb64a7bf3f1f74e2cb4c4437d93bc3d8921cf7e3d7ad2ab20989" + name = "github.com/graphql-go/graphql" + packages = [ + ".", + "gqlerrors", + "language/ast", + "language/kinds", + "language/lexer", + "language/location", + "language/parser", + "language/printer", + "language/source", + "language/typeInfo", + "language/visitor", + ] + pruneopts = "UT" + revision = "2b0b7340d2285b861482047fbf5de0488e021bea" + version = "v0.7.8" + +[[projects]] + digest = "1:d15ee511aa0f56baacc1eb4c6b922fa1c03b38413b6be18166b996d82a0156ea" + name = "github.com/hashicorp/golang-lru" + packages = [ + ".", + "simplelru", + ] + pruneopts = "UT" + revision = "7087cb70de9f7a8bc0a10c375cb0d2280a8edf9c" + version = "v0.5.1" + +[[projects]] + digest = "1:ff312c4d510c67954a6fc6a11c9ff72a2b2169584776b7419c7b8c729e2b13ac" + name = "github.com/jinzhu/gorm" + packages = [ + ".", + "dialects/mysql", + "dialects/postgres", + "dialects/sqlite", + ] + pruneopts = "UT" + revision = "472c70caa40267cb89fd8facb07fe6454b578626" + version = "v1.9.2" + +[[projects]] + branch = "master" + digest = "1:fd97437fbb6b7dce04132cf06775bd258cce305c44add58eb55ca86c6c325160" + name = "github.com/jinzhu/inflection" + packages = ["."] + pruneopts = "UT" + revision = "04140366298a54a039076d798123ffa108fff46c" + +[[projects]] + digest = "1:ecd9aa82687cf31d1585d4ac61d0ba180e42e8a6182b85bd785fcca8dfeefc1b" + name = "github.com/joho/godotenv" + packages = ["."] + pruneopts = "UT" + revision = "23d116af351c84513e1946b527c88823e476be13" + version = "v1.3.0" + +[[projects]] + digest = "1:b18ffc558326ebaed3b4a175617f1e12ed4e3f53d6ebfe5ba372a3de16d22278" + name = "github.com/lib/pq" + packages = [ + ".", + "hstore", + "oid", + ] + pruneopts = "UT" + revision = "4ded0e9383f75c197b3a2aaa6d590ac52df6fd79" + version = "v1.0.0" + +[[projects]] + digest = "1:4a49346ca45376a2bba679ca0e83bec949d780d4e927931317904bad482943ec" + name = "github.com/mattn/go-sqlite3" + packages = ["."] + pruneopts = "UT" + revision = "c7c4067b79cc51e6dfdcef5c702e74b1e0fa7c75" + version = "v1.10.0" + +[[projects]] + digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" + name = "github.com/pmezard/go-difflib" + packages = ["difflib"] + pruneopts = "UT" + revision = "792786c7400a136282c1664665ae0a8db921c6c2" + version = "v1.0.0" + +[[projects]] + branch = "master" + digest = "1:8dd6663207b795abbe94a20d2785c9eb16be59183f5468e8816f98aeda466c7f" + name = "github.com/rendon/testcli" + packages = ["."] + pruneopts = "UT" + revision = "6283090d169f51a2410b4e260341a01c9a4c0ca7" + +[[projects]] + digest = "1:9421f6e9e28ef86933e824b5caff441366f2b69bb281085b9dca40e1f27a1602" + name = "github.com/shurcooL/sanitized_anchor_name" + packages = ["."] + pruneopts = "UT" + revision = "7bfe4c7ecddb3666a94b053b422cdd8f5aaa3615" + version = "v1.0.0" + +[[projects]] + digest = "1:972c2427413d41a1e06ca4897e8528e5a1622894050e2f527b38ddf0f343f759" + name = "github.com/stretchr/testify" + packages = ["assert"] + pruneopts = "UT" + revision = "ffdc059bfe9ce6a4e144ba849dbedead332c6053" + version = "v1.3.0" + +[[projects]] + digest = "1:b4e8aaca88f799355f4ac560bce4293fb85ff21003dd0d5741ca503f7a788e91" + name = "github.com/vektah/gqlparser" + packages = [ + ".", + "ast", + "gqlerror", + "lexer", + "parser", + "validator", + "validator/rules", + ] + pruneopts = "UT" + revision = "05741cdb0871330d8bc980d4afd21ab34eceee83" + version = "v1.1.2" + +[[projects]] + branch = "master" + digest = "1:9d5b5d543996dd584da1db1e0de1926f3e4c3a8dba0fa2f8db70f3ebee2342e0" + name = "golang.org/x/crypto" + packages = [ + "bcrypt", + "blowfish", + ] + pruneopts = "UT" + revision = "a5d413f7728c81fb97d96a2b722368945f651e78" + +[[projects]] + digest = "1:c25289f43ac4a68d88b02245742347c94f1e108c534dda442188015ff80669b3" + name = "google.golang.org/appengine" + packages = ["cloudsql"] + pruneopts = "UT" + revision = "54a98f90d1c46b7731eb8fb305d2a321c30ef610" + version = "v1.5.0" + +[[projects]] + branch = "v3" + digest = "1:7388652e2215a3f45d341d58766ed58317971030eb1cbd75f005f96ace8e9196" + name = "gopkg.in/alexcesaro/quotedprintable.v3" + packages = ["."] + pruneopts = "UT" + revision = "2caba252f4dc53eaf6b553000885530023f54623" + +[[projects]] + digest = "1:c805e517269b0ba4c21ded5836019ed7d16953d4026cb7d00041d039c7906be9" + name = "gopkg.in/natefinch/lumberjack.v2" + packages = ["."] + pruneopts = "UT" + revision = "a96e63847dc3c67d17befa69c303767e2f84e54f" + version = "v2.1" + +[[projects]] + digest = "1:2ee0f15eb0fb04f918db7c2dcf39745f40d69f798ef171610a730e8a56aaa4fd" + name = "gopkg.in/russross/blackfriday.v2" + packages = ["."] + pruneopts = "UT" + revision = "d3b5b032dc8e8927d31a5071b56e14c89f045135" + version = "v2.0.1" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + input-imports = [ + "github.com/99designs/gqlgen/graphql", + "github.com/99designs/gqlgen/graphql/introspection", + "github.com/99designs/gqlgen/handler", + "github.com/GeertJohan/go.rice", + "github.com/GeertJohan/go.rice/embedded", + "github.com/ararog/timeago", + "github.com/go-mail/mail", + "github.com/go-yaml/yaml", + "github.com/gorilla/mux", + "github.com/gorilla/sessions", + "github.com/graphql-go/graphql", + "github.com/jinzhu/gorm", + "github.com/jinzhu/gorm/dialects/mysql", + "github.com/jinzhu/gorm/dialects/postgres", + "github.com/jinzhu/gorm/dialects/sqlite", + "github.com/joho/godotenv", + "github.com/rendon/testcli", + "github.com/stretchr/testify/assert", + "github.com/vektah/gqlparser", + "github.com/vektah/gqlparser/ast", + "golang.org/x/crypto/bcrypt", + "gopkg.in/natefinch/lumberjack.v2", + "gopkg.in/russross/blackfriday.v2", + ] + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml new file mode 100644 index 00000000..d628fa21 --- /dev/null +++ b/Gopkg.toml @@ -0,0 +1,94 @@ +# Gopkg.toml example +# +# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" +# +# [prune] +# non-go = false +# go-tests = true +# unused-packages = true + + +[[constraint]] + name = "github.com/99designs/gqlgen" + version = "0.8.3" + +[[constraint]] + name = "github.com/GeertJohan/go.rice" + version = "1.0.0" + +[[constraint]] + name = "github.com/ararog/timeago" + version = "0.0.1" + +[[constraint]] + name = "github.com/go-mail/mail" + version = "2.3.1" + +[[constraint]] + name = "github.com/go-yaml/yaml" + version = "2.2.2" + +[[constraint]] + name = "github.com/gorilla/mux" + version = "1.7.0" + +[[constraint]] + name = "github.com/gorilla/sessions" + version = "1.1.3" + +[[constraint]] + name = "github.com/graphql-go/graphql" + version = "0.7.8" + +[[constraint]] + name = "github.com/jinzhu/gorm" + version = "1.9.2" + +[[constraint]] + name = "github.com/joho/godotenv" + version = "1.3.0" + +[[constraint]] + branch = "master" + name = "github.com/rendon/testcli" + +[[constraint]] + name = "github.com/stretchr/testify" + version = "1.3.0" + +[[constraint]] + name = "github.com/vektah/gqlparser" + version = "1.1.2" + +[[constraint]] + branch = "master" + name = "golang.org/x/crypto" + +[[constraint]] + name = "gopkg.in/natefinch/lumberjack.v2" + version = "2.1.0" + +[[constraint]] + name = "gopkg.in/russross/blackfriday.v2" + version = "2.0.1" + +[prune] + go-tests = true + unused-packages = true diff --git a/handlers/graphql/generated.go b/handlers/graphql/generated.go index bae52338..f695d553 100644 --- a/handlers/graphql/generated.go +++ b/handlers/graphql/generated.go @@ -36,7 +36,9 @@ type Config struct { type ResolverRoot interface { Checkin() CheckinResolver + Core() CoreResolver Group() GroupResolver + Message() MessageResolver Query() QueryResolver Service() ServiceResolver User() UserResolver @@ -67,6 +69,19 @@ type ComplexityRoot struct { Id func(childComplexity int) int } + Core struct { + CreatedAt func(childComplexity int) int + Description func(childComplexity int) int + Domain func(childComplexity int) int + Footer func(childComplexity int) int + Name func(childComplexity int) int + Started func(childComplexity int) int + Timezone func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UsingCdn func(childComplexity int) int + Version func(childComplexity int) int + } + Failure struct { CreatedAt func(childComplexity int) int ErrorCode func(childComplexity int) int @@ -86,11 +101,28 @@ type ComplexityRoot struct { UpdatedAt func(childComplexity int) int } + Message struct { + CreatedAt func(childComplexity int) int + Description func(childComplexity int) int + EndOn func(childComplexity int) int + Id func(childComplexity int) int + NotifyBefore func(childComplexity int) int + NotifyBeforeScale func(childComplexity int) int + NotifyMethod func(childComplexity int) int + NotifyUsers func(childComplexity int) int + StartOn func(childComplexity int) int + Title func(childComplexity int) int + UpdatedAt func(childComplexity int) int + } + Query struct { Checkin func(childComplexity int, id int64) int Checkins func(childComplexity int) int + Core func(childComplexity int) int Group func(childComplexity int, id int64) int Groups func(childComplexity int) int + Message func(childComplexity int, id int64) int + Messages func(childComplexity int) int Service func(childComplexity int, id int64) int Services func(childComplexity int) int User func(childComplexity int, id int64) int @@ -144,10 +176,22 @@ type CheckinResolver interface { Failures(ctx context.Context, obj *types.Checkin) ([]*types.Failure, error) } +type CoreResolver interface { + Footer(ctx context.Context, obj *types.Core) (string, error) + + Timezone(ctx context.Context, obj *types.Core) (string, error) + UsingCdn(ctx context.Context, obj *types.Core) (bool, error) +} type GroupResolver interface { Public(ctx context.Context, obj *types.Group) (bool, error) } +type MessageResolver interface { + NotifyUsers(ctx context.Context, obj *types.Message) (bool, error) + NotifyMethod(ctx context.Context, obj *types.Message) (bool, error) + NotifyBefore(ctx context.Context, obj *types.Message) (int, error) +} type QueryResolver interface { + Core(ctx context.Context) (*types.Core, error) Service(ctx context.Context, id int64) (*types.Service, error) Services(ctx context.Context) ([]*types.Service, error) Group(ctx context.Context, id int64) (*types.Group, error) @@ -156,6 +200,8 @@ type QueryResolver interface { Users(ctx context.Context) ([]*types.User, error) Checkin(ctx context.Context, id int64) (*types.Checkin, error) Checkins(ctx context.Context) ([]*types.Checkin, error) + Message(ctx context.Context, id int64) (*types.Message, error) + Messages(ctx context.Context) ([]*types.Message, error) } type ServiceResolver interface { Expected(ctx context.Context, obj *types.Service) (string, error) @@ -296,6 +342,76 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.CheckinHit.Id(childComplexity), true + case "Core.CreatedAt": + if e.complexity.Core.CreatedAt == nil { + break + } + + return e.complexity.Core.CreatedAt(childComplexity), true + + case "Core.Description": + if e.complexity.Core.Description == nil { + break + } + + return e.complexity.Core.Description(childComplexity), true + + case "Core.Domain": + if e.complexity.Core.Domain == nil { + break + } + + return e.complexity.Core.Domain(childComplexity), true + + case "Core.Footer": + if e.complexity.Core.Footer == nil { + break + } + + return e.complexity.Core.Footer(childComplexity), true + + case "Core.Name": + if e.complexity.Core.Name == nil { + break + } + + return e.complexity.Core.Name(childComplexity), true + + case "Core.Started": + if e.complexity.Core.Started == nil { + break + } + + return e.complexity.Core.Started(childComplexity), true + + case "Core.Timezone": + if e.complexity.Core.Timezone == nil { + break + } + + return e.complexity.Core.Timezone(childComplexity), true + + case "Core.UpdatedAt": + if e.complexity.Core.UpdatedAt == nil { + break + } + + return e.complexity.Core.UpdatedAt(childComplexity), true + + case "Core.UsingCdn": + if e.complexity.Core.UsingCdn == nil { + break + } + + return e.complexity.Core.UsingCdn(childComplexity), true + + case "Core.Version": + if e.complexity.Core.Version == nil { + break + } + + return e.complexity.Core.Version(childComplexity), true + case "Failure.CreatedAt": if e.complexity.Failure.CreatedAt == nil { break @@ -387,6 +503,83 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Group.UpdatedAt(childComplexity), true + case "Message.CreatedAt": + if e.complexity.Message.CreatedAt == nil { + break + } + + return e.complexity.Message.CreatedAt(childComplexity), true + + case "Message.Description": + if e.complexity.Message.Description == nil { + break + } + + return e.complexity.Message.Description(childComplexity), true + + case "Message.EndOn": + if e.complexity.Message.EndOn == nil { + break + } + + return e.complexity.Message.EndOn(childComplexity), true + + case "Message.Id": + if e.complexity.Message.Id == nil { + break + } + + return e.complexity.Message.Id(childComplexity), true + + case "Message.NotifyBefore": + if e.complexity.Message.NotifyBefore == nil { + break + } + + return e.complexity.Message.NotifyBefore(childComplexity), true + + case "Message.NotifyBeforeScale": + if e.complexity.Message.NotifyBeforeScale == nil { + break + } + + return e.complexity.Message.NotifyBeforeScale(childComplexity), true + + case "Message.NotifyMethod": + if e.complexity.Message.NotifyMethod == nil { + break + } + + return e.complexity.Message.NotifyMethod(childComplexity), true + + case "Message.NotifyUsers": + if e.complexity.Message.NotifyUsers == nil { + break + } + + return e.complexity.Message.NotifyUsers(childComplexity), true + + case "Message.StartOn": + if e.complexity.Message.StartOn == nil { + break + } + + return e.complexity.Message.StartOn(childComplexity), true + + case "Message.Title": + if e.complexity.Message.Title == nil { + break + } + + return e.complexity.Message.Title(childComplexity), true + + case "Message.UpdatedAt": + if e.complexity.Message.UpdatedAt == nil { + break + } + + return e.complexity.Message.UpdatedAt(childComplexity), true + case "Query.Checkin": if e.complexity.Query.Checkin == nil { break @@ -406,6 +599,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.Checkins(childComplexity), true + case "Query.Core": + if e.complexity.Query.Core == nil { + break + } + + return e.complexity.Query.Core(childComplexity), true + case "Query.Group": if e.complexity.Query.Group == nil { break @@ -425,6 +625,25 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.Groups(childComplexity), true + case "Query.Message": + if e.complexity.Query.Message == nil { + break + } + + args, err := ec.field_Query_message_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Message(childComplexity, args["id"].(int64)), true + + case "Query.Messages": + if e.complexity.Query.Messages == nil { + break + } + + return e.complexity.Query.Messages(childComplexity), true + case "Query.Service": if e.complexity.Query.Service == nil { break @@ -777,6 +996,7 @@ var parsedSchema = gqlparser.MustLoadSchema( } type Query { + core: Core service(id: ID!): Service services: [Service]! group(id: ID!): Group @@ -785,6 +1005,21 @@ type Query { users: [User]! checkin(id: ID!): Checkin checkins: [Checkin]! + message(id: ID!): Message + messages: [Message]! +} + +type Core { + name: String! + description: String! + footer: String! + domain: String! + version: String! + timezone: String! + using_cdn: Boolean! + started_on: Time! + created_at: Time! + updated_at: Time! } type Service { @@ -868,6 +1103,20 @@ type Failure { created_at: Time! } +type Message { + id: ID! + title: String! + description: String! + start_on: Time! + end_on: Time! + notify_users: Boolean! + notify_method: Boolean! + notify_before: Int! + notify_before_scale: String! + created_at: Time! + updated_at: Time! +} + scalar Time`}, ) @@ -917,6 +1166,20 @@ func (ec *executionContext) field_Query_group_args(ctx context.Context, rawArgs return args, nil } +func (ec *executionContext) field_Query_message_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 int64 + if tmp, ok := rawArgs["id"]; ok { + arg0, err = ec.unmarshalNID2int64(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + func (ec *executionContext) field_Query_service_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -1376,6 +1639,276 @@ func (ec *executionContext) _CheckinHit_created_at(ctx context.Context, field gr return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } +func (ec *executionContext) _Core_name(ctx context.Context, field graphql.CollectedField, obj *types.Core) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Core", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Core_description(ctx context.Context, field graphql.CollectedField, obj *types.Core) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Core", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Core_footer(ctx context.Context, field graphql.CollectedField, obj *types.Core) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Core", + Field: field, + Args: nil, + IsMethod: true, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Core().Footer(rctx, obj) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Core_domain(ctx context.Context, field graphql.CollectedField, obj *types.Core) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Core", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Domain, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Core_version(ctx context.Context, field graphql.CollectedField, obj *types.Core) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Core", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Version, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Core_timezone(ctx context.Context, field graphql.CollectedField, obj *types.Core) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Core", + Field: field, + Args: nil, + IsMethod: true, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Core().Timezone(rctx, obj) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Core_using_cdn(ctx context.Context, field graphql.CollectedField, obj *types.Core) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Core", + Field: field, + Args: nil, + IsMethod: true, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Core().UsingCdn(rctx, obj) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) _Core_started_on(ctx context.Context, field graphql.CollectedField, obj *types.Core) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Core", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Started, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) _Core_created_at(ctx context.Context, field graphql.CollectedField, obj *types.Core) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Core", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) _Core_updated_at(ctx context.Context, field graphql.CollectedField, obj *types.Core) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Core", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedAt, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + func (ec *executionContext) _Failure_id(ctx context.Context, field graphql.CollectedField, obj *types.Failure) graphql.Marshaler { ctx = ec.Tracer.StartFieldExecution(ctx, field) defer func() { ec.Tracer.EndFieldExecution(ctx) }() @@ -1727,6 +2260,327 @@ func (ec *executionContext) _Group_updated_at(ctx context.Context, field graphql return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } +func (ec *executionContext) _Message_id(ctx context.Context, field graphql.CollectedField, obj *types.Message) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Message", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Id, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int64) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNID2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Message_title(ctx context.Context, field graphql.CollectedField, obj *types.Message) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Message", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Title, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Message_description(ctx context.Context, field graphql.CollectedField, obj *types.Message) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Message", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Message_start_on(ctx context.Context, field graphql.CollectedField, obj *types.Message) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Message", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StartOn, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) _Message_end_on(ctx context.Context, field graphql.CollectedField, obj *types.Message) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Message", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EndOn, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) _Message_notify_users(ctx context.Context, field graphql.CollectedField, obj *types.Message) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Message", + Field: field, + Args: nil, + IsMethod: true, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Message().NotifyUsers(rctx, obj) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) _Message_notify_method(ctx context.Context, field graphql.CollectedField, obj *types.Message) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Message", + Field: field, + Args: nil, + IsMethod: true, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Message().NotifyMethod(rctx, obj) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) _Message_notify_before(ctx context.Context, field graphql.CollectedField, obj *types.Message) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Message", + Field: field, + Args: nil, + IsMethod: true, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Message().NotifyBefore(rctx, obj) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) _Message_notify_before_scale(ctx context.Context, field graphql.CollectedField, obj *types.Message) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Message", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NotifyBeforeScale, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Message_created_at(ctx context.Context, field graphql.CollectedField, obj *types.Message) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Message", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) _Message_updated_at(ctx context.Context, field graphql.CollectedField, obj *types.Message) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Message", + Field: field, + Args: nil, + IsMethod: false, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedAt, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) _Query_core(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Core(rctx) + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*types.Core) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalOCore2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋtypesᚐCore(ctx, field.Selections, res) +} + func (ec *executionContext) _Query_service(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { ctx = ec.Tracer.StartFieldExecution(ctx, field) defer func() { ec.Tracer.EndFieldExecution(ctx) }() @@ -1959,6 +2813,64 @@ func (ec *executionContext) _Query_checkins(ctx context.Context, field graphql.C return ec.marshalNCheckin2ᚕᚖgithubᚗcomᚋhunterlongᚋstatpingᚋtypesᚐCheckin(ctx, field.Selections, res) } +func (ec *executionContext) _Query_message(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + } + ctx = graphql.WithResolverContext(ctx, rctx) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Query_message_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + rctx.Args = args + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Message(rctx, args["id"].(int64)) + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*types.Message) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalOMessage2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋtypesᚐMessage(ctx, field.Selections, res) +} + +func (ec *executionContext) _Query_messages(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Messages(rctx) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*types.Message) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + return ec.marshalNMessage2ᚕᚖgithubᚗcomᚋhunterlongᚋstatpingᚋtypesᚐMessage(ctx, field.Selections, res) +} + func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { ctx = ec.Tracer.StartFieldExecution(ctx, field) defer func() { ec.Tracer.EndFieldExecution(ctx) }() @@ -1987,7 +2899,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col res := resTmp.(*introspection.Type) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalO__Type2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { @@ -2011,7 +2923,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C res := resTmp.(*introspection.Schema) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalO__Schema2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) } func (ec *executionContext) _Service_id(ctx context.Context, field graphql.CollectedField, obj *types.Service) graphql.Marshaler { @@ -3058,7 +3970,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, field.Selections, res) + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, field.Selections, res) } func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { @@ -3238,7 +4150,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, field.Selections, res) + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, field.Selections, res) } func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { @@ -3265,7 +4177,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col res := resTmp.(*introspection.Type) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalN__Type2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { @@ -3394,7 +4306,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq res := resTmp.(*introspection.Type) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalN__Type2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { @@ -3445,7 +4357,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalN__Type2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { @@ -3472,7 +4384,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph res := resTmp.(*introspection.Type) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalN__Type2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { @@ -3496,7 +4408,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr res := resTmp.(*introspection.Type) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalO__Type2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { @@ -3520,7 +4432,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel res := resTmp.(*introspection.Type) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalO__Type2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { @@ -3547,7 +4459,7 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalN__Directive2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, field.Selections, res) + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, field.Selections, res) } func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { @@ -3653,7 +4565,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalO__Field2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, field.Selections, res) + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, field.Selections, res) } func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { @@ -3677,7 +4589,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalO__Type2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { @@ -3701,7 +4613,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalO__Type2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { @@ -3732,7 +4644,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, field.Selections, res) + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, field.Selections, res) } func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { @@ -3756,7 +4668,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, field.Selections, res) + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, field.Selections, res) } func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { @@ -3780,7 +4692,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co res := resTmp.(*introspection.Type) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec.marshalO__Type2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } // endregion **************************** field.gotpl ***************************** @@ -3926,6 +4838,105 @@ func (ec *executionContext) _CheckinHit(ctx context.Context, sel ast.SelectionSe return out } +var coreImplementors = []string{"Core"} + +func (ec *executionContext) _Core(ctx context.Context, sel ast.SelectionSet, obj *types.Core) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, coreImplementors) + + out := graphql.NewFieldSet(fields) + invalid := false + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Core") + case "name": + out.Values[i] = ec._Core_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "description": + out.Values[i] = ec._Core_description(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "footer": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Core_footer(ctx, field, obj) + if res == graphql.Null { + invalid = true + } + return res + }) + case "domain": + out.Values[i] = ec._Core_domain(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "version": + out.Values[i] = ec._Core_version(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "timezone": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Core_timezone(ctx, field, obj) + if res == graphql.Null { + invalid = true + } + return res + }) + case "using_cdn": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Core_using_cdn(ctx, field, obj) + if res == graphql.Null { + invalid = true + } + return res + }) + case "started_on": + out.Values[i] = ec._Core_started_on(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "created_at": + out.Values[i] = ec._Core_created_at(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "updated_at": + out.Values[i] = ec._Core_updated_at(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalid { + return graphql.Null + } + return out +} + var failureImplementors = []string{"Failure"} func (ec *executionContext) _Failure(ctx context.Context, sel ast.SelectionSet, obj *types.Failure) graphql.Marshaler { @@ -4044,6 +5055,110 @@ func (ec *executionContext) _Group(ctx context.Context, sel ast.SelectionSet, ob return out } +var messageImplementors = []string{"Message"} + +func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, obj *types.Message) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, messageImplementors) + + out := graphql.NewFieldSet(fields) + invalid := false + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Message") + case "id": + out.Values[i] = ec._Message_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "title": + out.Values[i] = ec._Message_title(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "description": + out.Values[i] = ec._Message_description(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "start_on": + out.Values[i] = ec._Message_start_on(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "end_on": + out.Values[i] = ec._Message_end_on(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "notify_users": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Message_notify_users(ctx, field, obj) + if res == graphql.Null { + invalid = true + } + return res + }) + case "notify_method": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Message_notify_method(ctx, field, obj) + if res == graphql.Null { + invalid = true + } + return res + }) + case "notify_before": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Message_notify_before(ctx, field, obj) + if res == graphql.Null { + invalid = true + } + return res + }) + case "notify_before_scale": + out.Values[i] = ec._Message_notify_before_scale(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "created_at": + out.Values[i] = ec._Message_created_at(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "updated_at": + out.Values[i] = ec._Message_updated_at(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalid { + return graphql.Null + } + return out +} + var queryImplementors = []string{"Query"} func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { @@ -4059,6 +5174,17 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Query") + case "core": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core(ctx, field) + return res + }) case "service": field := field out.Concurrently(i, func() (res graphql.Marshaler) { @@ -4159,6 +5285,31 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } return res }) + case "message": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_message(ctx, field) + return res + }) + case "messages": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_messages(ctx, field) + if res == graphql.Null { + invalid = true + } + return res + }) case "__type": out.Values[i] = ec._Query___type(ctx, field) case "__schema": @@ -4853,6 +6004,43 @@ func (ec *executionContext) marshalNInt2int64(ctx context.Context, sel ast.Selec return graphql.MarshalInt64(v) } +func (ec *executionContext) marshalNMessage2ᚕᚖgithubᚗcomᚋhunterlongᚋstatpingᚋtypesᚐMessage(ctx context.Context, sel ast.SelectionSet, v []*types.Message) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + rctx := &graphql.ResolverContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOMessage2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋtypesᚐMessage(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + func (ec *executionContext) marshalNService2githubᚗcomᚋhunterlongᚋstatpingᚋtypesᚐService(ctx context.Context, sel ast.SelectionSet, v types.Service) graphql.Marshaler { return ec._Service(ctx, sel, &v) } @@ -4963,11 +6151,11 @@ func (ec *executionContext) marshalNUser2ᚕᚖgithubᚗcomᚋhunterlongᚋstatp return ret } -func (ec *executionContext) marshalN__Directive2githubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { return ec.___Directive(ctx, sel, &v) } -func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { +func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -4991,7 +6179,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋhunterlongᚋs if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__Directive2githubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) } if isLen1 { f(i) @@ -5069,19 +6257,19 @@ func (ec *executionContext) marshalN__DirectiveLocation2ᚕstring(ctx context.Co return ret } -func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { return ec.___EnumValue(ctx, sel, &v) } -func (ec *executionContext) marshalN__Field2githubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { return ec.___Field(ctx, sel, &v) } -func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { return ec.___InputValue(ctx, sel, &v) } -func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { +func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -5105,7 +6293,7 @@ func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋhunterlongᚋ if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__InputValue2githubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) } if isLen1 { f(i) @@ -5118,11 +6306,11 @@ func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋhunterlongᚋ return ret } -func (ec *executionContext) marshalN__Type2githubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { return ec.___Type(ctx, sel, &v) } -func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { +func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -5146,7 +6334,7 @@ func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋhunterlongᚋstatpi if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__Type2githubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) } if isLen1 { f(i) @@ -5159,7 +6347,7 @@ func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋhunterlongᚋstatpi return ret } -func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { if v == nil { if !ec.HasError(graphql.GetResolverContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -5262,6 +6450,17 @@ func (ec *executionContext) marshalOCheckinHit2ᚖgithubᚗcomᚋhunterlongᚋst return ec._CheckinHit(ctx, sel, v) } +func (ec *executionContext) marshalOCore2githubᚗcomᚋhunterlongᚋstatpingᚋtypesᚐCore(ctx context.Context, sel ast.SelectionSet, v types.Core) graphql.Marshaler { + return ec._Core(ctx, sel, &v) +} + +func (ec *executionContext) marshalOCore2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋtypesᚐCore(ctx context.Context, sel ast.SelectionSet, v *types.Core) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Core(ctx, sel, v) +} + func (ec *executionContext) marshalOFailure2githubᚗcomᚋhunterlongᚋstatpingᚋtypesᚐFailure(ctx context.Context, sel ast.SelectionSet, v types.Failure) graphql.Marshaler { return ec._Failure(ctx, sel, &v) } @@ -5324,6 +6523,17 @@ func (ec *executionContext) marshalOGroup2ᚖgithubᚗcomᚋhunterlongᚋstatpin return ec._Group(ctx, sel, v) } +func (ec *executionContext) marshalOMessage2githubᚗcomᚋhunterlongᚋstatpingᚋtypesᚐMessage(ctx context.Context, sel ast.SelectionSet, v types.Message) graphql.Marshaler { + return ec._Message(ctx, sel, &v) +} + +func (ec *executionContext) marshalOMessage2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋtypesᚐMessage(ctx context.Context, sel ast.SelectionSet, v *types.Message) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Message(ctx, sel, v) +} + func (ec *executionContext) marshalOService2githubᚗcomᚋhunterlongᚋstatpingᚋtypesᚐService(ctx context.Context, sel ast.SelectionSet, v types.Service) graphql.Marshaler { return ec._Service(ctx, sel, &v) } @@ -5369,7 +6579,7 @@ func (ec *executionContext) marshalOUser2ᚖgithubᚗcomᚋhunterlongᚋstatping return ec._User(ctx, sel, v) } -func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { +func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { if v == nil { return graphql.Null } @@ -5396,7 +6606,7 @@ func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋhunterlongᚋs if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) } if isLen1 { f(i) @@ -5409,7 +6619,7 @@ func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋhunterlongᚋs return ret } -func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { +func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { if v == nil { return graphql.Null } @@ -5436,7 +6646,7 @@ func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋhunterlongᚋstatp if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__Field2githubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) } if isLen1 { f(i) @@ -5449,7 +6659,7 @@ func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋhunterlongᚋstatp return ret } -func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { +func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { if v == nil { return graphql.Null } @@ -5476,7 +6686,7 @@ func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋhunterlongᚋ if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__InputValue2githubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) } if isLen1 { f(i) @@ -5489,22 +6699,22 @@ func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋhunterlongᚋ return ret } -func (ec *executionContext) marshalO__Schema2githubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v introspection.Schema) graphql.Marshaler { +func (ec *executionContext) marshalO__Schema2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v introspection.Schema) graphql.Marshaler { return ec.___Schema(ctx, sel, &v) } -func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { +func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { if v == nil { return graphql.Null } return ec.___Schema(ctx, sel, v) } -func (ec *executionContext) marshalO__Type2githubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { +func (ec *executionContext) marshalO__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { return ec.___Type(ctx, sel, &v) } -func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { +func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { if v == nil { return graphql.Null } @@ -5531,7 +6741,7 @@ func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋhunterlongᚋstatpi if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__Type2githubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) } if isLen1 { f(i) @@ -5544,7 +6754,7 @@ func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋhunterlongᚋstatpi return ret } -func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋhunterlongᚋstatpingᚋvendorᚋgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { +func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { if v == nil { return graphql.Null } diff --git a/handlers/graphql/gqlgen.yml b/handlers/graphql/gqlgen.yml index 7141a12a..86eea34c 100644 --- a/handlers/graphql/gqlgen.yml +++ b/handlers/graphql/gqlgen.yml @@ -10,6 +10,10 @@ exec: model: filename: models_gen.go models: + Core: + model: github.com/hunterlong/statping/types.Core + Message: + model: github.com/hunterlong/statping/types.Message Group: model: github.com/hunterlong/statping/types.Group Service: diff --git a/handlers/graphql/resolver.go b/handlers/graphql/resolver.go index 528f786a..7d357241 100644 --- a/handlers/graphql/resolver.go +++ b/handlers/graphql/resolver.go @@ -14,9 +14,15 @@ type Resolver struct{} func (r *Resolver) Checkin() CheckinResolver { return &checkinResolver{r} } +func (r *Resolver) Core() CoreResolver { + return &coreResolver{r} +} func (r *Resolver) Group() GroupResolver { return &groupResolver{r} } +func (r *Resolver) Message() MessageResolver { + return &messageResolver{r} +} func (r *Resolver) Query() QueryResolver { return &queryResolver{r} } @@ -30,9 +36,39 @@ func (r *Resolver) User() UserResolver { type checkinResolver struct{ *Resolver } func (r *checkinResolver) Service(ctx context.Context, obj *types.Checkin) (*types.Service, error) { - panic("not implemented") + service := core.SelectService(obj.ServiceId) + return service.Service, nil } func (r *checkinResolver) Failures(ctx context.Context, obj *types.Checkin) ([]*types.Failure, error) { + all := obj.Failures + var objs []*types.Failure + for _, v := range all { + objs = append(objs, v.Select()) + } + return objs, nil +} + +type coreResolver struct{ *Resolver } + +func (r *coreResolver) Footer(ctx context.Context, obj *types.Core) (string, error) { + panic("not implemented") +} +func (r *coreResolver) Timezone(ctx context.Context, obj *types.Core) (string, error) { + panic("not implemented") +} +func (r *coreResolver) UsingCdn(ctx context.Context, obj *types.Core) (bool, error) { + panic("not implemented") +} + +type messageResolver struct{ *Resolver } + +func (r *messageResolver) NotifyUsers(ctx context.Context, obj *types.Message) (bool, error) { + panic("not implemented") +} +func (r *messageResolver) NotifyMethod(ctx context.Context, obj *types.Message) (bool, error) { + panic("not implemented") +} +func (r *messageResolver) NotifyBefore(ctx context.Context, obj *types.Message) (int, error) { panic("not implemented") } @@ -44,6 +80,24 @@ func (r *groupResolver) Public(ctx context.Context, obj *types.Group) (bool, err type queryResolver struct{ *Resolver } +func (r *queryResolver) Core(ctx context.Context) (*types.Core, error) { + c := core.CoreApp + return c.Core, nil +} + +func (r *queryResolver) Message(ctx context.Context, id int64) (*types.Message, error) { + message, err := core.SelectMessage(id) + return message.Message, err +} +func (r *queryResolver) Messages(ctx context.Context) ([]*types.Message, error) { + all, err := core.SelectMessages() + var objs []*types.Message + for _, v := range all { + objs = append(objs, v.Message) + } + return objs, err +} + func (r *queryResolver) Group(ctx context.Context, id int64) (*types.Group, error) { group := core.SelectGroup(id) return group.Group, nil diff --git a/handlers/graphql/schema.graphql b/handlers/graphql/schema.graphql index cdaf4112..d5b5a485 100644 --- a/handlers/graphql/schema.graphql +++ b/handlers/graphql/schema.graphql @@ -3,6 +3,7 @@ schema { } type Query { + core: Core service(id: ID!): Service services: [Service]! group(id: ID!): Group @@ -11,6 +12,21 @@ type Query { users: [User]! checkin(id: ID!): Checkin checkins: [Checkin]! + message(id: ID!): Message + messages: [Message]! +} + +type Core { + name: String! + description: String! + footer: String! + domain: String! + version: String! + timezone: String! + using_cdn: Boolean! + started_on: Time! + created_at: Time! + updated_at: Time! } type Service { @@ -94,4 +110,18 @@ type Failure { created_at: Time! } +type Message { + id: ID! + title: String! + description: String! + start_on: Time! + end_on: Time! + notify_users: Boolean! + notify_method: Boolean! + notify_before: Int! + notify_before_scale: String! + created_at: Time! + updated_at: Time! +} + scalar Time \ No newline at end of file diff --git a/handlers/setup.go b/handlers/setup.go index 5632dcdf..c79914f9 100644 --- a/handlers/setup.go +++ b/handlers/setup.go @@ -53,10 +53,11 @@ func processSetupHandler(w http.ResponseWriter, r *http.Request) { project := r.PostForm.Get("project") username := r.PostForm.Get("username") password := r.PostForm.Get("password") - //sample := r.PostForm.Get("sample_data") description := r.PostForm.Get("description") domain := r.PostForm.Get("domain") email := r.PostForm.Get("email") + sample := r.PostForm.Get("sample_data") == "on" + utils.Log(2, sample) dir := utils.Directory config := &core.DbConfig{ @@ -117,7 +118,9 @@ func processSetupHandler(w http.ResponseWriter, r *http.Request) { }) admin.Create() - core.SampleData() + if sample { + core.SampleData() + } core.InitApp() CacheStorage.Delete("/") resetCookies() diff --git a/version.txt b/version.txt index 4ebf5929..308acec6 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.80.53 +0.80.54