more work on struct validation

This commit is contained in:
tsmethurst 2021-08-30 13:38:06 +02:00
commit 6adec1ae4d
14 changed files with 455 additions and 144 deletions

View file

@ -20,7 +20,7 @@ package gtsmodel
// RouterSession is used to store and retrieve settings for a router session.
type RouterSession struct {
ID string `bun:"type:CHAR(26),pk,notnull"`
Auth []byte `bun:"type:bytea,notnull,nullzero"`
Crypt []byte `bun:"type:bytea,notnull,nullzero"`
ID string `validate:"required,ulid" bun:"type:CHAR(26),pk,nullzero,notnull"`
Auth []byte `validate:"required,len=32" bun:"type:bytea,notnull,nullzero"`
Crypt []byte `validate:"required,len=32" bun:"type:bytea,notnull,nullzero"`
}