本文整理匯總了Golang中github.com/remind101/pkg/trace.Trace函數的典型用法代碼示例。如果您正苦於以下問題:Golang Trace函數的具體用法?Golang Trace怎麽用?Golang Trace使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Trace函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Deploy
func (d *tracedDeployer) Deploy(ctx context.Context, p events.Deployment, w io.Writer) (err error) {
ctx, done := trace.Trace(ctx)
err = d.deployer.Deploy(ctx, p, w)
done(err, "Deploy",
"repository", p.Repository.FullName,
"creator", p.Deployment.Creator.Login,
"ref", p.Deployment.Ref,
"sha", p.Deployment.Sha,
)
return err
}
示例2: RegisterTaskDefinition
func (c *ecsClient) RegisterTaskDefinition(ctx context.Context, input *ecs.RegisterTaskDefinitionInput) (*ecs.RegisterTaskDefinitionOutput, error) {
if c.tdThrottle == nil {
// Only allow 1 task definition per second.
c.tdThrottle = time.NewTicker(time.Second)
}
<-c.tdThrottle.C
ctx, done := trace.Trace(ctx)
resp, err := c.ECS.RegisterTaskDefinition(input)
done(err, "RegisterTaskDefinition", "family", stringField(input.Family))
return resp, err
}
示例3: TraceDeploy
// TraceDeploy wraps a Deployer to perform tracing with package trace.
func TraceDeploy(d Deployer) Deployer {
return DeployerFunc(func(ctx context.Context, event events.Deployment, w io.Writer) (err error) {
ctx, done := trace.Trace(ctx)
err = d.Deploy(ctx, event, w)
done(err, "Deploy",
"repository", event.Repository.FullName,
"creator", event.Deployment.Creator.Login,
"ref", event.Deployment.Ref,
"sha", event.Deployment.Sha,
)
return err
})
}
示例4: PullImage
// PullImage wraps the docker clients PullImage to handle authentication.
func (c *Client) PullImage(ctx context.Context, opts docker.PullImageOptions) error {
var a docker.AuthConfiguration
reg := opts.Registry
if reg == "" {
reg = "https://index.docker.io/v1/"
}
if c, ok := c.Auth.Configs[reg]; ok {
a = c
}
ctx, done := trace.Trace(ctx)
err := c.Client.PullImage(opts, a)
done(err, "PullImage", "registry", opts.Registry, "repository", opts.Repository, "tag", opts.Tag)
return err
}
示例5: PullImage
// PullImage wraps the docker clients PullImage to handle authentication.
func (c *Client) PullImage(ctx context.Context, opts docker.PullImageOptions) error {
// This is to workaround an issue in the Docker API, where it doesn't
// respect the registry param. We have to put the registry in the
// repository field.
if opts.Registry != "" {
opts.Repository = fmt.Sprintf("%s/%s", opts.Registry, opts.Repository)
}
authConf, err := authConfiguration(c.AuthProvider, opts.Registry)
if err != nil {
return err
}
ctx, done := trace.Trace(ctx)
err = c.Client.PullImage(opts, authConf)
done(err, "PullImage", "registry", opts.Registry, "repository", opts.Repository, "tag", opts.Tag)
return err
}
示例6: ListServicesPages
func (c *ecsClient) ListServicesPages(ctx context.Context, input *ecs.ListServicesInput, fn func(*ecs.ListServicesOutput, bool) bool) error {
ctx, done := trace.Trace(ctx)
err := c.ECS.ListServicesPages(input, fn)
done(err, "ListServicesPages")
return err
}
示例7: DescribeTaskDefinition
func (c *ecsClient) DescribeTaskDefinition(ctx context.Context, input *ecs.DescribeTaskDefinitionInput) (*ecs.DescribeTaskDefinitionOutput, error) {
ctx, done := trace.Trace(ctx)
resp, err := c.ECS.DescribeTaskDefinition(input)
done(err, "DescribeTaskDefinition", "task-definition", stringField(input.TaskDefinition))
return resp, err
}
示例8: UpdateService
func (c *ecsClient) UpdateService(ctx context.Context, input *ecs.UpdateServiceInput) (*ecs.UpdateServiceOutput, error) {
ctx, done := trace.Trace(ctx)
resp, err := c.ECS.UpdateService(input)
done(err, "UpdateService", "service-name", stringField(input.Service), "desired-count", intField(input.DesiredCount), "task-definition", stringField(input.TaskDefinition))
return resp, err
}
示例9: ListServices
func (c *ecsClient) ListServices(ctx context.Context, input *ecs.ListServicesInput) (*ecs.ListServicesOutput, error) {
ctx, done := trace.Trace(ctx)
resp, err := c.ECS.ListServices(input)
done(err, "ListServices", "services", len(resp.ServiceARNs))
return resp, err
}
示例10: StartContainer
func (c *Client) StartContainer(ctx context.Context, id string, config *docker.HostConfig) error {
ctx, done := trace.Trace(ctx)
err := c.Client.StartContainer(id, config)
done(err, "StartContainer", "id", id)
return err
}
示例11: describeTasks
func (c *ecsClient) describeTasks(ctx context.Context, input *ecs.DescribeTasksInput) (*ecs.DescribeTasksOutput, error) {
ctx, done := trace.Trace(ctx)
resp, err := c.ECS.DescribeTasks(input)
done(err, "DescribeTasks", "tasks", len(input.Tasks))
return resp, err
}
示例12: DescribeServices
func (c *ecsClient) DescribeServices(ctx context.Context, input *ecs.DescribeServicesInput) (*ecs.DescribeServicesOutput, error) {
ctx, done := trace.Trace(ctx)
resp, err := c.ECS.DescribeServices(input)
done(err, "DescribeServices", "services", len(input.Services))
return resp, err
}
示例13: RemoveContainer
func (c *Client) RemoveContainer(ctx context.Context, opts docker.RemoveContainerOptions) error {
ctx, done := trace.Trace(ctx)
err := c.Client.RemoveContainer(opts)
done(err, "RemoveContainer", "id", opts.ID)
return err
}
示例14: ping
func ping(ctx context.Context) (err error) {
ctx, done := trace.Trace(ctx)
defer done(nil, "pong")
return
}
示例15: StopTask
func (c *ecsClient) StopTask(ctx context.Context, input *ecs.StopTaskInput) (*ecs.StopTaskOutput, error) {
ctx, done := trace.Trace(ctx)
resp, err := c.ECS.StopTask(input)
done(err, "StopTask", "task", stringField(input.Task))
return resp, err
}