shared

package
v0.0.0-...-03e236f Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GinErrors = GinErrorList{
		ServiceConnection: gin.H{
			"error": "could not connect to internal service",
		},
		UnknownError: gin.H{
			"error": "an unknown error occurred",
		},
		JsonParseError: gin.H{
			"error": "could not parse JSON",
		},
	}
	Errors = StandardErrorList{
		ServiceConnection: errors.New("could not connect to service"),
		UnknownError:      errors.New("an unknown error occurred"),
	}
	Db *sql.DB
)

Functions

func DefaultGrpcServer

func DefaultGrpcServer(registerComponents func(*grpc.Server))

func GetGrpcConn

func GetGrpcConn(connectionString string) (*grpc.ClientConn, error)

func GetPluginSources

func GetPluginSources(Id string, name string, uri string, uriType string) (int, error)

func JwtMiddleware

func JwtMiddleware(publicKey *rsa.PublicKey, mode string) gin.HandlerFunc

func RBACMiddleware

func RBACMiddleware(rbacService string, resource string, operations []string) gin.HandlerFunc

func SetEnv

func SetEnv(mode *string)

Types

type CustomQuestions

type CustomQuestions struct {
	PluginId    uint64 `json:"pluginId"`
	SystemState bool   `json:"systemState"`
	UserState   bool   `json:"userState"`
}

type Exam

type Exam struct {
	Sections []SectionIntermediate
}

func (*Exam) Validate

func (res *Exam) Validate() error

type GinErrorList

type GinErrorList struct {
	ServiceConnection gin.H
	UnknownError      gin.H
	JsonParseError    gin.H
}

type Grid

type Grid struct {
	Type     string `json:"type"`
	PluginId uint64 `json:"pluginId"`
	Css      string `json:"css"`
}

type Layout

type Layout struct {
	Grid [][]Grid `json:"grid"`
}

type Plugin

type Plugin struct {
	*ServerSide `json:"serverSide"`
}

func ParsePlugin

func ParsePlugin(name string) (Plugin, error)

type PooledQuestions

type PooledQuestions struct {
	NumQuestions int    `json:"numQuestions"`
	Type         string `json:"type"`
	PoolId       uint64 `json:"poolId"`
}

type PooledSetQuestions

type PooledSetQuestions struct {
	NumQuestions int     `json:"numQuestions"`
	Type         string  `json:"type"`
	PooledSets   [][]int `json:"pooledSets"`
}

type QuestionConfig

func (*QuestionConfig) UnmarshalJSON

func (res *QuestionConfig) UnmarshalJSON(data []byte) error

type Section

type Section struct {
	Name string `json:"name"`
	SectionSwitch
	QuestionConfig QuestionConfig `json:"questionConfig"`
	Layout         Layout         `json:"layout"`
}

type SectionIntermediate

type SectionIntermediate struct {
	Section
}

func (*SectionIntermediate) UnmarshalJSON

func (res *SectionIntermediate) UnmarshalJSON(data []byte) error

type SectionSwitch

type SectionSwitch struct {
	SectionType string
}

type ServerSide

type ServerSide struct {
	Dockerfile string `json:"dockerfile"`
	Context    string `json:"context"`
}

type SetQuestions

type SetQuestions struct {
	Sets []int `json:"sets"`
}

type StandardErrorList

type StandardErrorList struct {
	ServiceConnection error
	UnknownError      error
}

type StandardQuestions

type StandardQuestions struct {
	Questions []uint64 `json:"questions"`
}

type UserJWT

type UserJWT struct {
	UserId string
	Scope  uint64
}

Jump to

Keyboard shortcuts

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