Skip to content

Commit

Permalink
[Tavern][Feature] Added names for sessions, and a neat random generat…
Browse files Browse the repository at this point in the history
…or (#113)

* Added names for sessions, and a neat random generator

* removed unneeded files

* oops
  • Loading branch information
KCarretto authored Feb 24, 2023
1 parent 644261c commit 8475a5b
Show file tree
Hide file tree
Showing 20 changed files with 1,103 additions and 20 deletions.
4 changes: 4 additions & 0 deletions tavern/ent/gql_mutation_input.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 15 additions & 7 deletions tavern/ent/gql_node.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions tavern/ent/gql_where_input.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tavern/ent/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 55 additions & 1 deletion tavern/ent/mutation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions tavern/ent/runtime/runtime.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions tavern/ent/schema/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"fmt"
"io"

"github.com/kcarretto/realm/tavern/namegen"

"entgo.io/contrib/entgql"
"entgo.io/ent"
"entgo.io/ent/schema"
Expand All @@ -21,6 +23,11 @@ type Session struct {
// Fields of the Session.
func (Session) Fields() []ent.Field {
return []ent.Field{
field.String("name").
NotEmpty().
Unique().
DefaultFunc(namegen.GetRandomName).
Comment("A human readable identifier for the session."),
field.String("principal").
Optional().
NotEmpty().
Expand Down
13 changes: 12 additions & 1 deletion tavern/ent/session.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions tavern/ent/session/session.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8475a5b

Please sign in to comment.