本文整理汇总了Golang中github.com/remind101/pkg/trace.Trace函数的典型用法代码示例。如果您正苦于以下问题:Golang Trace函数的具体用法?Golang Trace怎么用?Golang Trace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Trace函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
}
开发者ID:4eek,项目名称:empire,代码行数:11,代码来源:deployer.go
示例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
}
开发者ID:brianz,项目名称:empire,代码行数:13,代码来源:ecs.go
示例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
})
}
开发者ID:brianz,项目名称:empire,代码行数:14,代码来源:deployer.go
示例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
}
开发者ID:aaithal,项目名称:empire,代码行数:19,代码来源:client.go
示例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
}
开发者ID:carriercomm,项目名称:empire,代码行数:19,代码来源:client.go
示例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
}
开发者ID:brianz,项目名称:empire,代码行数:6,代码来源:ecs.go
示例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
}
开发者ID:brianz,项目名称:empire,代码行数:6,代码来源:ecs.go
示例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
}
开发者ID:brianz,项目名称:empire,代码行数:6,代码来源:ecs.go
示例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
}
开发者ID:yourchanges,项目名称:empire,代码行数:6,代码来源:ecs.go
示例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
}
开发者ID:aaithal,项目名称:empire,代码行数:6,代码来源:client.go
示例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
}
开发者ID:brianz,项目名称:empire,代码行数:6,代码来源:ecs.go
示例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
}
开发者ID:brianz,项目名称:empire,代码行数:6,代码来源:ecs.go
示例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
}
开发者ID:frewsxcv,项目名称:empire,代码行数:6,代码来源:client.go
示例14: ping
func ping(ctx context.Context) (err error) {
ctx, done := trace.Trace(ctx)
defer done(nil, "pong")
return
}
开发者ID:frewsxcv,项目名称:empire,代码行数:6,代码来源:example_test.go
示例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
}
开发者ID:brianz,项目名称:empire,代码行数:6,代码来源:ecs.go
示例16: StopContainer
func (c *Client) StopContainer(ctx context.Context, id string, timeout uint) error {
ctx, done := trace.Trace(ctx)
err := c.Client.StopContainer(id, timeout)
done(err, "StopContainer", "id", id, "timeout", timeout)
return err
}
开发者ID:aaithal,项目名称:empire,代码行数:6,代码来源:client.go
示例17: RunTask
func (c *ecsClient) RunTask(ctx context.Context, input *ecs.RunTaskInput) (*ecs.RunTaskOutput, error) {
ctx, done := trace.Trace(ctx)
resp, err := c.ECS.RunTask(input)
done(err, "RunTask", "taskDefinition", stringField(input.TaskDefinition))
return resp, err
}
开发者ID:brianz,项目名称:empire,代码行数:6,代码来源:ecs.go
示例18: CreateContainer
func (c *Client) CreateContainer(ctx context.Context, opts docker.CreateContainerOptions) (*docker.Container, error) {
ctx, done := trace.Trace(ctx)
container, err := c.Client.CreateContainer(opts)
done(err, "CreateContainer", "image", opts.Config.Image)
return container, err
}
开发者ID:aaithal,项目名称:empire,代码行数:6,代码来源:client.go
示例19: DeleteService
func (c *ecsClient) DeleteService(ctx context.Context, input *ecs.DeleteServiceInput) (*ecs.DeleteServiceOutput, error) {
ctx, done := trace.Trace(ctx)
resp, err := c.ECS.DeleteService(input)
done(err, "DeleteService", "service-name", stringField(input.Service))
return resp, err
}
开发者ID:brianz,项目名称:empire,代码行数:6,代码来源:ecs.go
示例20: AttachToContainer
func (c *Client) AttachToContainer(ctx context.Context, opts docker.AttachToContainerOptions) error {
ctx, done := trace.Trace(ctx)
err := c.Client.AttachToContainer(opts)
done(err, "AttachToContainer", "container", opts.Container)
return err
}
开发者ID:aaithal,项目名称:empire,代码行数:6,代码来源:client.go
注:本文中的github.com/remind101/pkg/trace.Trace函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论