• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang trace.Trace函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang spectrum.Application类代码示例发布时间:2022-05-28
下一篇:
Golang timex.Now函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap