Documentation ¶
Overview ¶
Package teams encapsulates reading/writing teams entities to Spanner.
Index ¶
Constants ¶
View Source
const (
// TeamIDExpression is a partial regular expression that validates team identifiers.
TeamIDExpression = `[0-9a-f]{32}`
)
Variables ¶
View Source
var NotExistsErr error = errors.New("team was not found")
NotExistsErr is returned when the requested object was not found in the database.
Functions ¶
func Create ¶
Create creates a team entry in the Spanner Database. Must be called with an active RW transaction in the context. CreateTime in the passed in team will be ignored in favour of the commit time.
func GenerateID ¶
GenerateID returns a random 128-bit team ID, encoded as 32 lowercase hexadecimal characters.
Types ¶
type Team ¶
type Team struct { // Unique identifier of the team. ID string // Time the team was created. CreateTime time.Time }
Team mirrors the structure of team values in the database.
type TeamBuilder ¶
type TeamBuilder struct {
// contains filtered or unexported fields
}
func NewTeamBuilder ¶
func NewTeamBuilder() *TeamBuilder
func (*TeamBuilder) Build ¶
func (b *TeamBuilder) Build() *Team
func (*TeamBuilder) CreateInDB ¶
func (b *TeamBuilder) CreateInDB(ctx context.Context) (*Team, error)
func (*TeamBuilder) WithCreateTime ¶
func (b *TeamBuilder) WithCreateTime(createTime time.Time) *TeamBuilder
func (*TeamBuilder) WithID ¶
func (b *TeamBuilder) WithID(id string) *TeamBuilder
Click to show internal directories.
Click to hide internal directories.