File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -7,24 +7,24 @@ import (
77)
88
99type Config struct {
10- registry string
11- applicationName string
12- serverAddress string
10+ Registry string
11+ ApplicationName string
12+ ServerAddress string
1313}
1414
1515type NeutralCP struct {
16- config Config
16+ Config Config
1717}
1818
1919func (n * NeutralCP ) Start (ctx context.Context ) error {
2020 log .Println ("Start neutral-cp" )
2121
22- switch n .config . registry {
22+ switch n .Config . Registry {
2323 case "pyroscope" :
2424 n .startPyroscope (ctx )
2525
2626 default :
27- return errors .New ("unsupported registry: " + n .config . registry )
27+ return errors .New ("unsupported registry: " + n .Config . Registry )
2828 }
2929
3030 return nil
Original file line number Diff line number Diff line change 88
99func (n * NeutralCP ) startPyroscope (ctx context.Context ) error {
1010 p , err := profiler .Start (profiler.Config {
11- ApplicationName : n .config . applicationName ,
11+ ApplicationName : n .Config . ApplicationName ,
1212
13- ServerAddress : n .config . serverAddress ,
13+ ServerAddress : n .Config . ServerAddress ,
1414
1515 ProfileTypes : []profiler.ProfileType {
1616 profiler .ProfileCPU ,
Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ import (
88
99func TestStart (t * testing.T ) {
1010 c := Config {
11- registry : "pyroscope" ,
12- applicationName : "testApp" ,
11+ Registry : "pyroscope" ,
12+ ApplicationName : "testApp" ,
1313 }
14- ncp := NeutralCP {config : c }
14+ ncp := NeutralCP {Config : c }
1515
1616 ctx := context .Background ()
1717 ctx , cancel := context .WithTimeout (ctx , 1 * time .Second )
You can’t perform that action at this time.
0 commit comments