Versions in this module Expand all Collapse all v0 v0.1.1 Jan 13, 2023 v0.1.0 Jan 12, 2023 Changes in this version + const NameMaxLength + const NameMinLength + var ErrAccountIDNegative = errors.New("account id must be positive") + var ErrAccountIDRequired = errors.New("account id is required") + var ErrIDNegative = errors.New("id must be positive") + var ErrIDRequired = errors.New("id is required") + var ErrLimitNegative = errors.New("limit must be positive") + var ErrNameBetween = errors.New("name must be between 2 and 50 character(s) long") + var ErrNameRequired = errors.New("name is required") + var ErrOffsetNegative = errors.New("offset must be positive") + type Config struct + Database Database + GRPC GRPC + type CreateRequest struct + AccountID int64 + Name string + type Database struct + Host string + Name string + Password string + Port int + SSL SSL + Username string + type FindManyRequest struct + AccountID int64 + Limit int32 + Offset int32 + type FindManyResponse struct + Offices []*Office + Total int32 + type FindOneRequest struct + ID int64 + type FindOneResponse struct + Office *Office + type GRPC struct + Port int + type Normalize struct + func NewNormalize(s Service) Normalize + func (n Normalize) Create(ctx context.Context, r *CreateRequest) error + func (n Normalize) FindMany(ctx context.Context, r *FindManyRequest) (*FindManyResponse, error) + func (n Normalize) FindOne(ctx context.Context, r *FindOneRequest) (*FindOneResponse, error) + func (n Normalize) Update(ctx context.Context, r *UpdateRequest) error + type Office struct + ID int64 + Name string + type SSL string + const Disable + const Enable + type Service interface + Create func(ctx context.Context, r *CreateRequest) error + FindMany func(ctx context.Context, r *FindManyRequest) (*FindManyResponse, error) + FindOne func(ctx context.Context, r *FindOneRequest) (*FindOneResponse, error) + Update func(ctx context.Context, r *UpdateRequest) error + type TemplateService interface + ExecuteTemplate func(w http.ResponseWriter, page fmt.Stringer) error + Parse func(patterns string) error + type UpdateRequest struct + ID int64 + Name string + type Validate struct + func NewValidate(s Service) Validate + func (v Validate) Create(ctx context.Context, r *CreateRequest) error + func (v Validate) FindMany(ctx context.Context, r *FindManyRequest) (*FindManyResponse, error) + func (v Validate) FindOne(ctx context.Context, r *FindOneRequest) (*FindOneResponse, error) + func (v Validate) Update(ctx context.Context, r *UpdateRequest) error