workspace

package
v0.0.0-...-46e61fc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountWorkspace

type AccountWorkspace struct {
	WorkspaceID uuid.UUID    `json:"workspaceID"`
	AccountID   uuid.UUID    `json:"accountID"`
	Role        account.Role `json:"role"`
	CreatedAt   time.Time    `json:"createdAt"`
	UpdatedAt   time.Time    `json:"updatedAt"`
}

func (*AccountWorkspace) ToResponse

func (a *AccountWorkspace) ToResponse() *role.Response

func (*AccountWorkspace) ToResponseWithEmailAndUsername

func (a *AccountWorkspace) ToResponseWithEmailAndUsername(email, username string) *role.Response

func (*AccountWorkspace) Update

func (a *AccountWorkspace) Update(data *role.Data)

type Data

type Data struct {
	WorkspaceID        uuid.UUID `json:"workspaceID" swaggerignore:"true"`
	AccountID          uuid.UUID `json:"accountID" swaggerignore:"true"`
	Name               string    `json:"name"`
	Description        string    `json:"description"`
	AuthzMember        []string  `json:"authzMember"`
	AuthzAdmin         []string  `json:"authzAdmin"`
	Permissions        []string  `json:"permissions" swaggerignore:"true"`
	IsApplicationAdmin bool      `json:"isApplicationAdmin" swaggerignore:"true"`
}

func (*Data) CheckLdapGroups

func (d *Data) CheckLdapGroups(authorizationType auth.AuthenticationType) error

func (*Data) SetAccountData

func (d *Data) SetAccountData(accountData *proto.GetAccountDataResponse) *Data

func (*Data) SetWorkspaceID

func (d *Data) SetWorkspaceID(workspaceID uuid.UUID) *Data

func (*Data) ToBytes

func (d *Data) ToBytes() []byte

func (*Data) ToWorkspace

func (d *Data) ToWorkspace() *Workspace

func (*Data) Validate

func (d *Data) Validate() error

type Response

type Response struct {
	WorkspaceID       uuid.UUID      `json:"workspaceID"`
	Name              string         `json:"name"`
	Role              account.Role   `json:"role"`
	Description       string         `json:"description"`
	AuthzMember       pq.StringArray `json:"authzMember" gorm:"type:text[]"`
	AuthzAdmin        pq.StringArray `json:"authzAdmin" gorm:"type:text[]"`
	CreatedAt         time.Time      `json:"createdAt"`
	UpdatedAt         time.Time      `json:"updatedAt"`
	RepositoriesCount int            `json:"repositoriesCount"`
}

type Workspace

type Workspace struct {
	WorkspaceID uuid.UUID      `json:"workspaceID" gorm:"primary_key"`
	Name        string         `json:"name"`
	Description string         `json:"description"`
	AuthzMember pq.StringArray `json:"authzMember" gorm:"type:text[]"`
	AuthzAdmin  pq.StringArray `json:"authzAdmin" gorm:"type:text[]"`
	CreatedAt   time.Time      `json:"createdAt"`
	UpdatedAt   time.Time      `json:"updatedAt"`
}

func (*Workspace) ToAccountWorkspace

func (w *Workspace) ToAccountWorkspace(accountID uuid.UUID, role account.Role) *AccountWorkspace

func (*Workspace) ToUpdateMap

func (w *Workspace) ToUpdateMap(data *Data) map[string]interface{}

func (*Workspace) ToWorkspaceResponse

func (w *Workspace) ToWorkspaceResponse(role account.Role) *Response

func (*Workspace) Update

func (w *Workspace) Update(data *Data) *Workspace

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL