v1

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	MetaData ApplicationMetadata `bson:"_metadata" json:"_metadata"`
	Url      string              `bson:"url" json:"url"`
	Webhook  GitWebhook          `bson:"webhook" json:"webhook"`
}

Application contains application info

type ApplicationMetadata

type ApplicationMetadata struct {
	Labels           map[string]string `bson:"labels" json:"labels"`
	Id               string            `bson:"id" json:"id"`
	Name             string            `bson:"name" json:"name"`
	IsWebhookEnabled bool              `bson:"is_webhook_enabled" json:"is_webhook_enabled"`
}

ApplicationMetadata contains application metadata info

type Company

type Company struct {
	MetaData     CompanyMetadata `bson:"_metadata" json:"_metadata"`
	Id           string          `bson:"id" json:"id"`
	Name         string          `bson:"name" json:"name"`
	Repositories []Repository    `bson:"repositories" json:"repositories"`
}

Company contains company data

type CompanyMetadata

type CompanyMetadata struct {
	Labels                    map[string]string `bson:"labels" json:"labels" yaml:"labels"`
	NumberOfConcurrentProcess int64             `bson:"number_of_concurrent_process" json:"number_of_concurrent_process" yaml:"number_of_concurrent_process"`
	TotalProcessPerDay        int64             `bson:"total_process_per_day" json:"total_process_per_day" yaml:"total_process_per_day"`
}

CompanyMetadata contains company metadata info

type GitWebhook

type GitWebhook struct {
	Type   string   `json:"type"`
	ID     string   `json:"id"`
	Active bool     `json:"active"`
	Events []string `json:"events"`
	Config struct {
		URL         string `json:"url"`
		InsecureSsl string `json:"insecure_ssl"`
		ContentType string `json:"content_type"`
	} `json:"config"`
	UpdatedAt     time.Time `json:"updated_at"`
	CreatedAt     time.Time `json:"created_at"`
	URL           string    `json:"url"`
	TestURL       string    `json:"test_url"`
	PingURL       string    `json:"ping_url"`
	DeliveriesURL string    `json:"deliveries_url"`
}

GitWebhook contains github web hook data

type JWTPayLoad

type JWTPayLoad struct {
	AccessToken  string `json:"access_token" bson:"access_token"`
	RefreshToken string `json:"refresh_token" bson:"refresh_token"`
}

JWTPayLoad contains payload of JWT token.

type LoginDto

type LoginDto struct {
	Email    string `json:"email" bson:"email"`
	Password string `json:"password" bson:"password"`
}

LoginDto contains user login info.

type Otp

type Otp struct {
	ID      string    `json:"id" bson:"id"`
	Email   string    `json:"email" bson:"email"`
	Phone   string    `json:"phone" bson:"phone"`
	Otp     string    `json:"otp" bson:"otp"`
	Exp     time.Time `json:"exp" bson:"exp"`
	BaseUrl string    `json:"baseUrl" bson:"baseUrl"`
}

Otp contains otp data

type PasswordResetDto

type PasswordResetDto struct {
	Otp             string `json:"otp" bson:"otp"`
	Email           string `json:"email" bson:"email"`
	CurrentPassword string `json:"current_password" bson:"current_password"`
	NewPassword     string `json:"new_password" bson:"new_password"`
}

PasswordResetDto contains data for password reset

type Permission

type Permission struct {
	Name string `json:"name" bson:"name"`
}

Permission holds permission names.

func (Permission) Validate

func (p Permission) Validate() error

Validate validates Permission data

type RefreshTokenDto

type RefreshTokenDto struct {
	RefreshToken string `json:"refresh_token" bson:"refresh_token"`
}

RefreshTokenDto contains refresh token.

type Repository

type Repository struct {
	Id           string        `bson:"id" json:"id"`
	Type         string        `bson:"type" json:"type"`
	Token        string        `bson:"token" json:"token"`
	Applications []Application `bson:"applications" json:"applications"`
}

Repository contains repository info

type Resource

type Resource struct {
	Name string `json:"name" bson:"name"`
}

Resource holds resource name.

type ResourceWiseRoles

type ResourceWiseRoles struct {
	Name  string `json:"name" bson:"name"`
	Roles []Role `json:"roles" bson:"roles"`
}

ResourceWiseRoles dto that holds resource wise role dtos.

type ResourceWiseRolesDto

type ResourceWiseRolesDto struct {
	Name  string    `json:"name" bson:"name"`
	Roles []RoleDto `json:"roles" bson:"roles"`
}

ResourceWiseRolesDto holds resource wise roles.

type Role

type Role struct {
	Name string `json:"name" bson:"name"`
}

Role dto that holds role name.

func (Role) Validate

func (r Role) Validate() error

Validate validates RoleDto data

type RoleDto

type RoleDto struct {
	Name        string       `json:"name" bson:"name"`
	Permissions []Permission `json:"permissions" bson:"permissions"`
}

RoleDto holds role wise permissions.

type RoleUpdateOption

type RoleUpdateOption struct {
	Option enums.ROLE_UPDATE_OPTION `json:"option" bson:"option"`
}

RoleUpdateOption contains options for role update.

type RsaKeys

type RsaKeys struct {
	PrivateKey *rsa.PrivateKey
	PublicKey  *rsa.PublicKey
}

RsaKeys contains RSA keys.

type Token

type Token struct {
	Uid          string           `json:"uid" bson:"uid"`
	Token        string           `json:"token" bson:"token"`
	RefreshToken string           `json:"refresh_token" bson:"refresh_token"`
	Type         enums.TOKEN_TYPE `json:"type" bson:"type"`
}

Token contains token info.

type User

type User struct {
	Metadata           UserMetadata           `json:"metadata" bson:"metadata"`
	ID                 string                 `json:"id" bson:"id"`
	FirstName          string                 `json:"first_name" bson:"first_name" `
	LastName           string                 `json:"last_name" bson:"last_name"`
	Email              string                 `json:"email" bson:"email" `
	Phone              string                 `json:"phone" bson:"phone" `
	Password           string                 `json:"password" bson:"password" `
	Status             enums.STATUS           `json:"status" bson:"status"`
	CreatedDate        time.Time              `json:"created_date" bson:"created_date"`
	UpdatedDate        time.Time              `json:"updated_date" bson:"updated_date"`
	AuthType           enums.AUTH_TYPE        `json:"auth_type" bson:"auth_type"`
	ResourcePermission UserResourcePermission `json:"resource_permission" bson:"resource_permission"`
}

User holds users info.

func GetUserFromUserRegistrationDto

func GetUserFromUserRegistrationDto(u UserRegistrationDto) User

GetUserFromUserRegistrationDto converts User from UserRegistrationDto

type UserMetadata

type UserMetadata struct {
	CompanyId string `json:"company_id" bson:"company_id"`
	FirstName string `json:"first_name" bson:"-"`
	LastName  string `json:"last_name" bson:"-"`
}

UserMetadata holds users metadata.

type UserRegistrationDto

type UserRegistrationDto struct {
	Metadata           UserMetadata           `json:"metadata"`
	ID                 string                 `json:"id" bson:"id"`
	FirstName          string                 `json:"first_name" bson:"first_name" `
	LastName           string                 `json:"last_name" bson:"last_name"`
	Email              string                 `json:"email" bson:"email" `
	Phone              string                 `json:"phone" bson:"phone"`
	Password           string                 `json:"password" bson:"password" `
	Status             enums.STATUS           `json:"status" bson:"status"`
	CreatedDate        time.Time              `json:"created_date" bson:"created_date"`
	UpdatedDate        time.Time              `json:"updated_date" bson:"updated_date"`
	AuthType           enums.AUTH_TYPE        `json:"auth_type" bson:"auth_type"`
	ResourcePermission UserResourcePermission `json:"resource_permission" bson:"resource_permission"`
	BaseUrl            string                 `json:"base_url" bson:"base_url"`
}

UserRegistrationDto dto that holds user registration info.

func (UserRegistrationDto) Validate

func (u UserRegistrationDto) Validate() error

Validate validates UserRegistrationDto data

type UserResourcePermission

type UserResourcePermission struct {
	Resources []ResourceWiseRoles `json:"resources" bson:"resources"`
}

UserResourcePermission dto that holds metadata, user and resource wise roles.

func (UserResourcePermission) Validate

func (u UserResourcePermission) Validate() error

Validate validates UserResourcePermissionDto data

type UserResourcePermissionDto

type UserResourcePermissionDto struct {
	Metadata  UserMetadata           `json:"metadata" bson:"-"`
	UserId    string                 `json:"user_id" bson:"user_id"`
	Resources []ResourceWiseRolesDto `json:"resources" bson:"resources"`
}

UserResourcePermissionDto holds metadata, user and resource wise permissions.

type UsersCount

type UsersCount struct {
	Users struct {
		Active   int64 `json:"active"`
		Inactive int64 `json:"inactive"`
	} `json:"users"`
}

UsersCount contains active and inactive users count data

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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