Documentation ¶
Index ¶
- Constants
- Variables
- func CreateGuardRailRules(rule *GuardRailRules) error
- func CreateUser(user User) error
- func DeleteConnection(orgID, name string) error
- func DeleteGuardRailRules(orgID, ruleID string) error
- func DeleteUser(orgID, subject string) error
- func DeleteUserGroupsByUserID(userID string) error
- func InitDatabaseConnection() error
- func InsertUserGroups(userGroups []UserGroup) error
- func UpdateGuardRailRules(r *GuardRailRules) error
- func UpdateUser(user *User) error
- func UpdateUserAndUserGroups(user *User, userGroups []UserGroup) error
- func UpsertConnection(c *Connection) error
- type Connection
- type ConnectionFilterOption
- type ConnectionGuardRailRules
- type EnvVars
- type ErrNotFoundGuardRailRules
- type GuardRailRules
- type JiraIntegration
- type JiraIntegrationStatus
- type User
- func GetInvitedUserByEmail(email string) (*User, error)
- func GetUserByEmail(email string) (*User, error)
- func GetUserByEmailAndOrg(email, orgID string) (*User, error)
- func GetUserByOrgIDAndSlackID(orgID, slackID string) (*User, error)
- func GetUserBySubjectAndOrg(subject, orgID string) (*User, error)
- func ListUsers(orgID string) ([]User, error)
- type UserGroup
Constants ¶
View Source
const ( ConnectionStatusOnline = "online" ConnectionStatusOffline = "offline" )
Variables ¶
View Source
var ( ErrNotFound = fmt.Errorf("resource not found") ErrAlreadyExists = fmt.Errorf("resource already exists") )
View Source
var DB *gorm.DB
This makes the DB generally available to the application This is safe to access from multiple goroutines
Functions ¶
func CreateGuardRailRules ¶
func CreateGuardRailRules(rule *GuardRailRules) error
func CreateUser ¶
func DeleteConnection ¶
func DeleteGuardRailRules ¶
func DeleteUser ¶
func InitDatabaseConnection ¶
func InitDatabaseConnection() error
func InsertUserGroups ¶
func UpdateGuardRailRules ¶
func UpdateGuardRailRules(r *GuardRailRules) error
func UpdateUser ¶
func UpdateUserAndUserGroups ¶
func UpsertConnection ¶
func UpsertConnection(c *Connection) error
Types ¶
type Connection ¶
type Connection struct { OrgID string `gorm:"column:org_id"` ID string `gorm:"column:id"` AgentID sql.NullString `gorm:"column:agent_id"` Name string `gorm:"column:name"` Command pq.StringArray `gorm:"column:command;type:text[]"` Type string `gorm:"column:type"` SubType sql.NullString `gorm:"column:subtype"` Status string `gorm:"column:status"` ManagedBy sql.NullString `gorm:"column:managed_by"` Tags pq.StringArray `gorm:"column:_tags;type:text[]"` AccessModeRunbooks string `gorm:"column:access_mode_runbooks"` AccessModeExec string `gorm:"column:access_mode_exec"` AccessModeConnect string `gorm:"column:access_mode_connect"` AccessSchema string `gorm:"column:access_schema"` Envs map[string]string `gorm:"column:envs;serializer:json;->"` GuardRailRules pq.StringArray `gorm:"column:guardrail_rules;type:text[];->"` // Read Only fields RedactEnabled bool `gorm:"column:redact_enabled;->"` Reviewers pq.StringArray `gorm:"column:reviewers;type:text[];->"` RedactTypes pq.StringArray `gorm:"column:redact_types;type:text[];->"` AgentMode string `gorm:"column:agent_mode;->"` AgentName string `gorm:"column:agent_name;->"` }
func GetConnectionByNameOrID ¶
func GetConnectionByNameOrID(orgID, nameOrID string) (*Connection, error)
func ListConnections ¶
func ListConnections(orgID string, opts ConnectionFilterOption) ([]Connection, error)
func (Connection) AsSecrets ¶
func (c Connection) AsSecrets() map[string]any
type ConnectionFilterOption ¶
type ConnectionFilterOption struct { Type string SubType string ManagedBy string AgentID string Tags []string }
ConnectionOption each attribute set applies an AND operator logic
func (ConnectionFilterOption) GetTagsAsArray ¶
func (o ConnectionFilterOption) GetTagsAsArray() any
type ConnectionGuardRailRules ¶
type ConnectionGuardRailRules struct { OrgID string `gorm:"column:org_id"` ID string `gorm:"column:id"` Name string `gorm:"column:name"` // Read Only Fields GuardRailInputRules []byte `gorm:"column:guardrail_input_rules;->"` GuardRailOutputRules []byte `gorm:"column:guardrail_output_rules;->"` }
func GetConnectionGuardRailRules ¶
func GetConnectionGuardRailRules(orgID, name string) (*ConnectionGuardRailRules, error)
type ErrNotFoundGuardRailRules ¶
type ErrNotFoundGuardRailRules struct {
// contains filtered or unexported fields
}
func (*ErrNotFoundGuardRailRules) Error ¶
func (e *ErrNotFoundGuardRailRules) Error() string
type GuardRailRules ¶
type GuardRailRules struct { OrgID string `gorm:"column:org_id"` ID string `gorm:"column:id"` Name string `gorm:"column:name"` Description string `gorm:"column:description"` Input map[string]any `gorm:"column:input;serializer:json"` Output map[string]any `gorm:"column:output;serializer:json"` CreatedAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` }
func GetGuardRailRules ¶
func GetGuardRailRules(orgID, ruleID string) (*GuardRailRules, error)
func ListGuardRailRules ¶
func ListGuardRailRules(orgID string) ([]*GuardRailRules, error)
type JiraIntegration ¶
type JiraIntegration struct { ID string `json:"id"` OrgID string `json:"org_id"` URL string `json:"url"` User string `json:"user"` APIToken string `json:"api_token"` ProjectKey string `json:"project_key"` Status JiraIntegrationStatus `json:"status"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func CreateJiraIntegration ¶
func CreateJiraIntegration(orgID string, jiraIntegration *JiraIntegration) (*JiraIntegration, error)
func GetJiraIntegration ¶
func GetJiraIntegration(orgID string) (*JiraIntegration, error)
func UpdateJiraIntegration ¶
func UpdateJiraIntegration(orgID string, jiraIntegration *JiraIntegration) (*JiraIntegration, error)
type JiraIntegrationStatus ¶
type JiraIntegrationStatus string
const ( JiraIntegrationStatusActive JiraIntegrationStatus = "enabled" JiraIntegrationStatusInactive JiraIntegrationStatus = "disabled" )
type User ¶
type User struct { ID string OrgID string Subject string Name string Picture string Email string Verified bool Status string SlackID string HashedPassword string }
func GetInvitedUserByEmail ¶
func GetUserByEmail ¶
func GetUserByEmailAndOrg ¶
func GetUserBySubjectAndOrg ¶
Click to show internal directories.
Click to hide internal directories.