Documentation ¶
Index ¶
Constants ¶
View Source
const ( ProjectCredentialTableName = "project_credential" ProjectCredentialIdColumn = "credential_id" ProjectCredentialDomainColumn = "domain" )
View Source
const ( ProjectMembershipTableName = "project_membership" ProjectMembershipUsernameColumn = "username" ProjectMembershipProjectIdColumn = "project_id" ProjectMembershipRoleColumn = "role" )
View Source
const ( ProjectTableName = "project" ProjectPrefix = "project-" ProjectDescriptionColumn = "description" ProjectIdColumn = "project_id" ProjectExtraColumn = "extra" )
Variables ¶
View Source
var ProjectColumns = GetColumnsFromStruct(&Project{})
View Source
var ProjectCredentialColumns = GetColumnsFromStruct(&ProjectCredential{})
View Source
var ProjectMembershipColumns = GetColumnsFromStruct(&ProjectMembership{})
Functions ¶
func GetColumnsFromStruct ¶
func GetColumnsFromStruct(s interface{}) []string
func WithPrefix ¶
Types ¶
type Project ¶
type Project struct { ProjectId string `json:"project_id" db:"project_id"` Name string `json:"name"` Description string `json:"description"` Creator string `json:"creator"` CreateTime time.Time `json:"create_time"` Status string `json:"status"` Visibility string `json:"visibility"` Extra string `json:"extra"` }
func NewProject ¶
type ProjectCredential ¶
type ProjectCredential struct { ProjectId string `json:"project_id"` CredentialId string `json:"credential_id"` Domain string `json:"domain"` Creator string `json:"creator"` CreateTime time.Time `json:"create_time"` }
func NewProjectCredential ¶
func NewProjectCredential(projectId, credentialId, domain, creator string) *ProjectCredential
type ProjectMembership ¶
type ProjectMembership struct { Username string `json:"username"` ProjectId string `json:"project_id" db:"project_id"` Role string `json:"role"` Status string `json:"status"` GrantBy string `json:"grand_by,omitempty"` }
func NewProjectMemberShip ¶
func NewProjectMemberShip(username, projectId, role, grantBy string) *ProjectMembership
Click to show internal directories.
Click to hide internal directories.