gitee.com/liuxuezhan/go-micro-v1.18.0@v1.0.0/debug/profile/profile.go (about)

     1  // Package profile is for profilers
     2  package profile
     3  
     4  type Profile interface {
     5  	// Start the profiler
     6  	Start() error
     7  	// Stop the profiler
     8  	Stop() error
     9  }
    10  
    11  type Options struct {
    12  	// Name to use for the profile
    13  	Name string
    14  }
    15  
    16  type Option func(o *Options)
    17  
    18  // Name of the profile
    19  func Name(n string) Option {
    20  	return func(o *Options) {
    21  		o.Name = n
    22  	}
    23  }