repository

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: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountRepository

type AccountRepository struct {
	RepositoryID uuid.UUID         `json:"repositoryID"`
	AccountID    uuid.UUID         `json:"accountID"`
	WorkspaceID  uuid.UUID         `json:"workspaceID"`
	Role         accountEnums.Role `json:"role"`
	CreatedAt    time.Time         `json:"createdAt"`
	UpdatedAt    time.Time         `json:"updatedAt"`
}

TODO add unity tests

func (*AccountRepository) ToResponse

func (a *AccountRepository) ToResponse() *roleEntities.Response

func (*AccountRepository) ToResponseWithEmailAndUsername

func (a *AccountRepository) ToResponseWithEmailAndUsername(email, username string) *roleEntities.Response

func (*AccountRepository) Update

func (a *AccountRepository) Update(role accountEnums.Role)

type Data

type Data struct {
	WorkspaceID        uuid.UUID `json:"workspaceID" swaggerignore:"true"`
	RepositoryID       uuid.UUID `json:"repositoryID" 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"`
	AuthzSupervisor    []string  `json:"authzSupervisor"`
	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) SetWorkspaceAndRepositoryID

func (d *Data) SetWorkspaceAndRepositoryID(workspaceID, repositoryID uuid.UUID) *Data

func (*Data) SetWorkspaceIDAndAccountData

func (d *Data) SetWorkspaceIDAndAccountData(workspaceID uuid.UUID, accountData *proto.GetAccountDataResponse) *Data

func (*Data) ToBytes

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

func (*Data) ToRepository

func (d *Data) ToRepository() *Repository

func (*Data) Validate

func (d *Data) Validate() error

type PaginatedContent

type PaginatedContent struct {
	// ToRemove: Paginated method is optional for now because is not generate breaking changes
	Enable bool
	Page   int
	Size   int
	Search string
}

func (*PaginatedContent) GetOffset

func (p *PaginatedContent) GetOffset() int

func (*PaginatedContent) GetSearch

func (p *PaginatedContent) GetSearch() string

func (*PaginatedContent) SetEnable

func (p *PaginatedContent) SetEnable(enable bool) *PaginatedContent

func (*PaginatedContent) SetPage

func (p *PaginatedContent) SetPage(pageString string) *PaginatedContent

func (*PaginatedContent) SetSearch

func (p *PaginatedContent) SetSearch(search string) *PaginatedContent

func (*PaginatedContent) SetSize

func (p *PaginatedContent) SetSize(sizeString string) *PaginatedContent

type Repository

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

func (*Repository) ContainsAllAuthzGroups

func (r *Repository) ContainsAllAuthzGroups() bool

func (*Repository) ToAccountRepository

func (r *Repository) ToAccountRepository(accountID uuid.UUID, role account.Role) *AccountRepository

func (*Repository) ToRepositoryResponse

func (r *Repository) ToRepositoryResponse(role account.Role) *Response

func (*Repository) ToUpdateMap

func (r *Repository) ToUpdateMap(data *Data) map[string]interface{}

func (*Repository) Update

func (r *Repository) Update(data *Data) *Repository

type Response

type Response struct {
	WorkspaceID     uuid.UUID      `json:"workspaceID"`
	RepositoryID    uuid.UUID      `json:"repositoryID"`
	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[]"`
	AuthzSupervisor pq.StringArray `json:"authzSupervisor" gorm:"type:text[]"`
	CreatedAt       time.Time      `json:"createdAt"`
	UpdatedAt       time.Time      `json:"updatedAt"`
}

Jump to

Keyboard shortcuts

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