internal

package
v0.3.0-beta Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: GPL-3.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BitcoinAlphabet is the bitcoin alphabet.
	BitcoinAlphabet, _ = NewAlphabet("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
)

vars and funcs for pastes

Functions

func Contains

func Contains(s []string, str string) bool

Contains checks if a slice s has a string str and returns a bool

func CreateClusterDeployment

func CreateClusterDeployment(labRequest *LabRequest)

func Decode

func Decode(src string) ([]byte, error)

func DecodeAlphabet

func DecodeAlphabet(src string, alphabet *Alphabet) ([]byte, error)

func DefaultClientK8sAuthenticate

func DefaultClientK8sAuthenticate() (*rest.Config, error)

func DynamicClientK8sAuthenticate

func DynamicClientK8sAuthenticate() (Interface, error)

func Encode

func Encode(src []byte) string

func EncodeAlphabet

func EncodeAlphabet(src []byte, alphabet *Alphabet) string

func GenerateMultiplePastes

func GenerateMultiplePastes(bin string, contents map[string]string) map[string]string

func GenerateSSHKeys

func GenerateSSHKeys() (publickey []byte, privatekey []byte)

GenerateSSHKeys creates SSH Keys for LabRequest

func GenerateSinglePaste

func GenerateSinglePaste(bin string, contents map[string]string) map[string]string

func GetClusterDeployments

func GetClusterDeployments() map[string]interface{}

func GithubAuthenticate

func GithubAuthenticate() (*github.Client, context.Context)

func GoogleDriveAuthenticate

func GoogleDriveAuthenticate(credentials string, token string) (client *http.Client, err error)

func HiveClientK8sAuthenticate

func HiveClientK8sAuthenticate() runtimec.Client

func K8sAuthenticate

func K8sAuthenticate() *kubernetes.Clientset

func SendAdminEmail

func SendAdminEmail(to *[]string, cc *[]string, bcc *[]string, clusterinfo map[string]string)

func SendConfigEmail

func SendConfigEmail(to *[]string, cc *[]string, bcc *[]string, clusterinfo map[string]string)

func SendCredsEmail

func SendCredsEmail(to *[]string, cc *[]string, bcc *[]string, clusterinfo map[string]string)

func SendWelcomeEmail

func SendWelcomeEmail(to *[]string, cc *[]string, bcc *[]string, clusterinfo map[string]string)

Types

type Alphabet

type Alphabet struct {
	Decode [128]int8
	Encode [58]byte
}

func NewAlphabet

func NewAlphabet(src string) (*Alphabet, error)

type Cfg

type Cfg struct {
	Name             string `json:"name"`
	Host             string `json:"host"`
	Username         string `json:"username"`
	Password         string `json:"password"`
	Expire           string `json:"expire"`
	OpenDiscussion   bool   `json:"open_discussion"`
	BurnAfterReading bool   `json:"burn_after_reading"`
	Formatter        string `json:"formatter"`
}

type CreatePasteRequest

type CreatePasteRequest struct {
	V     int                    `json:"v"`
	AData []interface{}          `json:"adata"`
	Meta  CreatePasteRequestMeta `json:"meta"`
	CT    string                 `json:"ct"`
}

type CreatePasteRequestMeta

type CreatePasteRequestMeta struct {
	Expire string `json:"expire"`
}

type CreatePasteResponse

type CreatePasteResponse struct {
	ID          string `json:"id"`
	Status      int    `json:"status"`
	Message     string `json:"message"`
	URL         string `json:"url"`
	DeleteToken string `json:"deletetoken"`
}

type FormRequest

type FormRequest struct {
	Title string `json:"title" validate:"required"`
	Body  string `json:"body" validate:"required"`
}

type InstallConfig

type InstallConfig struct {
	BaseDomain        string
	WorkerReplicas    int
	MasterReplicas    int
	MasterSize        string
	WorkerSize        string
	ClusterName       string
	NetworkType       string
	ServiceNetwork    string
	Cloud             string
	RegionDesignation string
	Region            string
	PullSecret        string
	PublicSSHKey      string
}

type LabRequest

type LabRequest struct {
	Timestamp                    string    `json:"time"`
	Epoch                        int       `json:"epoch" validate:"required"`
	ID                           uuid.UUID `json:"labid" validate:"omitempty"`
	LeaseTime                    int       `json:"leaseTime" validate:"omitempty"`
	PrimaryContactName           string    `json:"primaryContactName" validate:"required"`
	PrimaryContactEmail          string    `json:"primaryContactEmail" validate:"required,email"`
	PrimaryContactPhoneNumber    string    `json:"primaryContactPhoneNumber" validate:"omitempty"`
	PrimaryContactConnectUser    bool      `json:"isPrimaryContactConnectUser" validate:"omitempty"`
	SecondaryContactName         string    `json:"secondaryContactName" validate:"required"`
	SecondaryContactEmail        string    `json:"secondaryContactEmail" validate:"required,email"`
	SecondaryContactPhoneNumber  string    `json:"secondaryContactPhoneNumber" validate:"omitempty"`
	SecondaryContactConnectUser  bool      `json:"isSecondaryContactConnectUser" validate:"omitempty"`
	RedHatSponsor                string    `json:"redHatSponsor" validate:"required"`
	Availability                 string    `json:"availability" validate:"required"`
	CompanyName                  string    `json:"companyName" validate:"required"`
	CompanyConnectPartner        bool      `json:"isCompanyConnectPartner" validate:"omitempty"`
	CertificationProject         string    `json:"certificationProject" validate:"omitempty"`
	IntendedCertificationProject string    `json:"intendedCertificationProject" validate:"omitempty"`
	ProjectName                  string    `json:"projectName" validate:"omitempty"`
	PublicSSHKey                 string    `json:"publicsshkey" validate:"omitempty"`
	ClusterName                  string    `json:"clusterName" validate:"required"`
	ClusterSize                  int       `json:"clusterSize" validate:"omitempty"`
	OpenShiftVersion             string    `json:"openShiftVersion" validate:"required"`
	Description                  string    `json:"description" validate:"omitempty"`
	Notes                        string    `json:"notes" validate:"omitempty"`
}

type LabRequestBranch

type LabRequestBranch struct {
	Base string `json:"base"`
	Lab  string `json:"labid"`
}

LabRequestBranch is the branch created when a LabRequest has been validated and approved. This branch is used when creating a PR for the LabRequest and is based on latest master

type LabRequestFile

type LabRequestFile struct {
	FileName          string `json:"filename"`
	FileCommitMessage string `json:"filecommitmessage"`
	FileContent       string `json:"filecontent"`
}

LabRequestFile is the file generated for a pull request when a LabRequest has been validated and approved. This file is created prior to creating the pull request.

type PBClient

type PBClient struct {
	URL      url.URL
	Username string
	Password string
}

func NewPBClient

func NewPBClient(uri *url.URL, username, password string) *PBClient

func (*PBClient) CreatePaste

func (c *PBClient) CreatePaste(message, expire, formatter string, openDiscussion, burnAfterReading bool) (*CreatePasteResponse, error)

type PasteContent

type PasteContent struct {
	Paste string `json:"paste"`
}

type PasteData

type PasteData struct {
	*PasteSpec
	Data             []byte
	Formatter        string
	OpenDiscussion   bool
	BurnAfterReading bool
}

type PasteSpec

type PasteSpec struct {
	IV          string
	Salt        string
	Iterations  int
	KeySize     int
	TagSize     int
	Algorithm   string
	Mode        string
	Compression string
}

func (*PasteSpec) SpecArray

func (ps *PasteSpec) SpecArray() []interface{}

type RequestForm

type RequestForm struct {
	ID                   uuid.UUID `json:"id" db:"id"`
	Time                 string    `json:"time" db:"time"`
	Epoch                string    `json:"epoch" db:"epoch"`
	Clusterid            string    `json:"clusterid" db:"clusterid"`
	Generatedclustername string    `json:"generatedclustername" db:"generatedclustername"`
	Provider             string    `json:"provider" db:"provider"`
	Openshiftversion     string    `json:"openshiftversion" db:"openshiftversion"`
	Clustersize          string    `json:"clustersize" db:"clustersize"`
	Companyname          string    `json:"companyname" db:"companyname"`
	Connectpartner       string    `json:"connectpartner" db:"connectpartner"`
	Sponsor              string    `json:"sponsor" db:"sponsor"`
	Primaryname          string    `json:"primaryname" db:"primaryname"`
	Primaryemail         string    `json:"primaryemail" db:"primaryemail"`
	Primaryphone         string    `json:"primaryphone" db:"primaryphone"`
	Primaryconnect       string    `json:"primaryconnect" db:"primaryconnect"`
	Secondaryname        string    `json:"secondaryname" db:"secondaryname"`
	Secondaryemail       string    `json:"secondaryemail" db:"secondaryemail"`
	Secondaryphone       string    `json:"secondaryphone" db:"secondaryphone"`
	Secondaryconnect     string    `json:"secondaryconnect" db:"secondaryconnect"`
	Timezone             string    `json:"timezone" db:"timezone"`
	Projectname          string    `json:"projectname" db:"projectname"`
	Clustername          string    `json:"clustername" db:"clustername"`
	Reservation          string    `json:"reservation" db:"reservation"`
	Certproject          string    `json:"certproject" db:"certproject"`
	Intendedcertproject  string    `json:"intendedcertproject" db:"intendedcertproject"`
	Description          string    `json:"description" db:"description"`
	Notes                string    `json:"notes" db:"notes"`
	Startdate            string    `json:"startdate" db:"startdate"`
	Enddate              string    `json:"enddate" db:"enddate"`
	State                string    `json:"state" db:"state"`
	CreatedAt            time.Time `json:"created_at" db:"created_at"`
	UpdatedAt            time.Time `json:"updated_at" db:"updated_at"`
}

RequestForm is used by pop to map your request_forms database table to your go code.

type UtcTime

type UtcTime struct {
	Status    string `json:"status"`
	Message   string `json:"message"`
	Formatted string `json:"formatted"`
}

Jump to

Keyboard shortcuts

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