Documentation ¶
Index ¶
- func MySCreateSourceString(user, password, host, dbName, SSLMode string) string
- type MySQLStore
- func (pg *MySQLStore) BatchCreateNotes(ctx context.Context, pID, uID string, notes map[string]*pb.Note) ([]*pb.Note, []error)
- func (pg *MySQLStore) BatchCreateOccurrences(ctx context.Context, pID string, uID string, occs []*pb.Occurrence) ([]*pb.Occurrence, []error)
- func (pg *MySQLStore) CreateNote(ctx context.Context, pID, nID, uID string, n *pb.Note) (*pb.Note, error)
- func (pg *MySQLStore) CreateOccurrence(ctx context.Context, pID, uID string, o *pb.Occurrence) (*pb.Occurrence, error)
- func (pg *MySQLStore) CreateProject(ctx context.Context, pID string, p *prpb.Project) (*prpb.Project, error)
- func (pg *MySQLStore) DeleteNote(ctx context.Context, pID, nID string) error
- func (pg *MySQLStore) DeleteOccurrence(ctx context.Context, pID, oID string) error
- func (pg *MySQLStore) DeleteProject(ctx context.Context, pID string) error
- func (pg *MySQLStore) GetNote(ctx context.Context, pID, nID string) (*pb.Note, error)
- func (pg *MySQLStore) GetOccurrence(ctx context.Context, pID, oID string) (*pb.Occurrence, error)
- func (pg *MySQLStore) GetOccurrenceNote(ctx context.Context, pID, oID string) (*pb.Note, error)
- func (pg *MySQLStore) GetProject(ctx context.Context, pID string) (*prpb.Project, error)
- func (pg *MySQLStore) GetVulnerabilityOccurrencesSummary(ctx context.Context, projectID, filter string) (*pb.VulnerabilityOccurrencesSummary, error)
- func (pg *MySQLStore) ListNoteOccurrences(ctx context.Context, pID, nID, filter, pageToken string, pageSize int32) ([]*pb.Occurrence, string, error)
- func (pg *MySQLStore) ListNotes(ctx context.Context, pID, filter, pageToken string, pageSize int32) ([]*pb.Note, string, error)
- func (pg *MySQLStore) ListOccurrences(ctx context.Context, pID, filter, pageToken string, pageSize int32) ([]*pb.Occurrence, string, error)
- func (pg *MySQLStore) ListProjects(ctx context.Context, filter string, pageSize int, pageToken string) ([]*prpb.Project, string, error)
- func (pg *MySQLStore) UpdateNote(ctx context.Context, pID, nID string, n *pb.Note, mask *fieldmaskpb.FieldMask) (*pb.Note, error)
- func (pg *MySQLStore) UpdateOccurrence(ctx context.Context, pID, oID string, o *pb.Occurrence, ...) (*pb.Occurrence, error)
- type MysqlFilterSql
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MySCreateSourceString ¶
CreateSourceString generates DB source path. username:password@protocol(address)/dbname?param=value %s:%s@tcp(%s)/%s
Types ¶
type MySQLStore ¶
func NewMySQLStore ¶
func NewMySQLStore(config *config.MySQLConfig) (*MySQLStore, error)
func (*MySQLStore) BatchCreateNotes ¶
func (pg *MySQLStore) BatchCreateNotes(ctx context.Context, pID, uID string, notes map[string]*pb.Note) ([]*pb.Note, []error)
BatchCreateNotes batch creates the specified notes in memstore.
func (*MySQLStore) BatchCreateOccurrences ¶
func (pg *MySQLStore) BatchCreateOccurrences(ctx context.Context, pID string, uID string, occs []*pb.Occurrence) ([]*pb.Occurrence, []error)
BatchCreateOccurrence batch creates the specified occurrences in PostreSQL.
func (*MySQLStore) CreateNote ¶
func (pg *MySQLStore) CreateNote(ctx context.Context, pID, nID, uID string, n *pb.Note) (*pb.Note, error)
CreateNote adds the specified note
func (*MySQLStore) CreateOccurrence ¶
func (pg *MySQLStore) CreateOccurrence(ctx context.Context, pID, uID string, o *pb.Occurrence) (*pb.Occurrence, error)
CreateOccurrence adds the specified occurrence
func (*MySQLStore) CreateProject ¶
func (pg *MySQLStore) CreateProject(ctx context.Context, pID string, p *prpb.Project) (*prpb.Project, error)
CreateProject adds the specified project to the store
func (*MySQLStore) DeleteNote ¶
func (pg *MySQLStore) DeleteNote(ctx context.Context, pID, nID string) error
DeleteNote deletes the note with the given pID and nID
func (*MySQLStore) DeleteOccurrence ¶
func (pg *MySQLStore) DeleteOccurrence(ctx context.Context, pID, oID string) error
DeleteOccurrence deletes the occurrence with the given pID and oID
func (*MySQLStore) DeleteProject ¶
func (pg *MySQLStore) DeleteProject(ctx context.Context, pID string) error
DeleteProject deletes the project with the given pID from the store
func (*MySQLStore) GetOccurrence ¶
func (pg *MySQLStore) GetOccurrence(ctx context.Context, pID, oID string) (*pb.Occurrence, error)
GetOccurrence returns the occurrence with pID and oID
func (*MySQLStore) GetOccurrenceNote ¶
GetOccurrenceNote gets the note for the specified occurrence from PostgreSQL.
func (*MySQLStore) GetProject ¶
GetProject returns the project with the given pID from the store
func (*MySQLStore) GetVulnerabilityOccurrencesSummary ¶
func (pg *MySQLStore) GetVulnerabilityOccurrencesSummary(ctx context.Context, projectID, filter string) (*pb.VulnerabilityOccurrencesSummary, error)
GetVulnerabilityOccurrencesSummary gets a summary of vulnerability occurrences from storage.
func (*MySQLStore) ListNoteOccurrences ¶
func (pg *MySQLStore) ListNoteOccurrences(ctx context.Context, pID, nID, filter, pageToken string, pageSize int32) ([]*pb.Occurrence, string, error)
ListNoteOccurrences returns up to pageSize number of occcurrences on the particular note (nID) for this project (pID) projects beginning at pageToken (or from start if pageToken is the empty string).
func (*MySQLStore) ListNotes ¶
func (pg *MySQLStore) ListNotes(ctx context.Context, pID, filter, pageToken string, pageSize int32) ([]*pb.Note, string, error)
ListNotes returns up to pageSize number of notes for this project (pID) beginning at pageToken (or from start if pageToken is the empty string).
func (*MySQLStore) ListOccurrences ¶
func (pg *MySQLStore) ListOccurrences(ctx context.Context, pID, filter, pageToken string, pageSize int32) ([]*pb.Occurrence, string, error)
ListOccurrences returns up to pageSize number of occurrences for this project beginning at pageToken, or from start if pageToken is the empty string.
func (*MySQLStore) ListProjects ¶
func (pg *MySQLStore) ListProjects(ctx context.Context, filter string, pageSize int, pageToken string) ([]*prpb.Project, string, error)
ListProjects returns up to pageSize number of projects beginning at pageToken (or from start if pageToken is the empty string).
func (*MySQLStore) UpdateNote ¶
func (pg *MySQLStore) UpdateNote(ctx context.Context, pID, nID string, n *pb.Note, mask *fieldmaskpb.FieldMask) (*pb.Note, error)
UpdateNote updates the existing note with the given pID and nID
func (*MySQLStore) UpdateOccurrence ¶
func (pg *MySQLStore) UpdateOccurrence(ctx context.Context, pID, oID string, o *pb.Occurrence, mask *fieldmaskpb.FieldMask) (*pb.Occurrence, error)
UpdateOccurrence updates the existing occurrence with the given projectID and occurrenceID
type MysqlFilterSql ¶
type MysqlFilterSql struct {
// contains filtered or unexported fields
}
func (*MysqlFilterSql) ParseFilter ¶
func (fs *MysqlFilterSql) ParseFilter(filter string) string