// Copyright 2015 - Present, The Gogs Authors. All rights reserved. // Copyright 2018 - Present, Gitote. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. package form import ( "github.com/go-macaron/binding" "gopkg.in/macaron.v1" ) // CreateOrg represents CreateOrg type CreateOrg struct { OrgName string `binding:"Required;AlphaDashDot;MaxSize(35)" locale:"org.org_name_holder"` } // Validate validates fields func (f *CreateOrg) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { return validate(errs, ctx.Data, f, ctx.Locale) } // UpdateOrgSetting holds org settings type UpdateOrgSetting struct { Name string `binding:"Required;AlphaDashDot;MaxSize(35)" locale:"org.org_name_holder"` FullName string `binding:"MaxSize(100)"` Description string `binding:"MaxSize(255)"` Website string `binding:"Url;MaxSize(100)"` Location string `binding:"MaxSize(50)"` IsVerified bool MaxRepoCreation int } // Validate validates fields func (f *UpdateOrgSetting) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { return validate(errs, ctx.Data, f, ctx.Locale) } // CreateTeam represents CreateTeam type CreateTeam struct { TeamName string `binding:"Required;AlphaDashDot;MaxSize(30)"` Description string `binding:"MaxSize(255)"` Permission string } // Validate validates fields func (f *CreateTeam) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { return validate(errs, ctx.Data, f, ctx.Locale) }