(executablePath, assetsPath, configPath string, logBufferSize, startupLogTailSize int)
| 44 | } |
| 45 | |
| 46 | func NewXRayCore(executablePath, assetsPath, configPath string, logBufferSize, startupLogTailSize int) (*Core, error) { |
| 47 | if startupLogTailSize <= 0 { |
| 48 | startupLogTailSize = 200 |
| 49 | } |
| 50 | |
| 51 | core := &Core{ |
| 52 | executablePath: executablePath, |
| 53 | assetsPath: assetsPath, |
| 54 | configPath: configPath, |
| 55 | logsChan: make(chan string, logBufferSize), |
| 56 | logPhase: logPhaseRuntime, |
| 57 | startupLogSize: startupLogTailSize, |
| 58 | runtimeLogs: newStartupLogRing(10), |
| 59 | } |
| 60 | |
| 61 | version, err := core.refreshVersion() |
| 62 | if err != nil { |
| 63 | return nil, err |
| 64 | } |
| 65 | core.version = version |
| 66 | |
| 67 | return core, nil |
| 68 | } |
| 69 | |
| 70 | func (c *Core) GenerateConfigFile(config []byte) error { |
| 71 | var prettyJSON bytes.Buffer |
no test coverage detected