Debian Codegraph @

v2/sarif/stack_frame.go

raw
1 package sarif
2
3 // StackFrame ...
4 type StackFrame struct {
5 Location *Location `json:"location,omitempty"`
6 Module *string `json:"module,omitempty"`
7 Parameters []string `json:"parameters,omitempty"`
8 ThreadID *int `json:"threadId,omitempty"`
9 PropertyBag
10 }
11
12 // NewStackFrame creates a new StackFrame and returns a pointer to it
13 func NewStackFrame() *StackFrame {
14 return &StackFrame{}
15 }
16
17 // WithLocation sets the Location
18 func (stackFrame *StackFrame) WithLocation(location *Location) *StackFrame {
19 stackFrame.Location = location
20 return stackFrame
21 }
22
23 // WithModule sets the Module
24 func (stackFrame *StackFrame) WithModule(module string) *StackFrame {
25 stackFrame.Module = &module
26 return stackFrame
27 }
28
29 // WithParameters sets the Parameters
30 func (stackFrame *StackFrame) WithParameters(parameters []string) *StackFrame {
31 stackFrame.Parameters = parameters
32 return stackFrame
33 }
34
35 // AddParameter ...
36 func (stackFrame *StackFrame) AddParameter(parameter string) {
37 stackFrame.Parameters = append(stackFrame.Parameters, parameter)
38 }
39
40 // WithThreadID sets the ThreadID
41 func (stackFrame *StackFrame) WithThreadID(threadID int) *StackFrame {
42 stackFrame.ThreadID = &threadID
43 return stackFrame
44 }