github.com/drone/runner-go@v1.12.0/registry/static.go (about)

     1  // Copyright 2019 Drone.IO Inc. All rights reserved.
     2  // Use of this source code is governed by the Polyform License
     3  // that can be found in the LICENSE file.
     4  
     5  package registry
     6  
     7  import (
     8  	"context"
     9  
    10  	"github.com/drone/drone-go/drone"
    11  )
    12  
    13  // Static returns a new static registry credential provider.
    14  // The static secret provider finds and returns the static list
    15  // of registry credentials.
    16  func Static(registries []*drone.Registry) Provider {
    17  	return &static{registries}
    18  }
    19  
    20  type static struct {
    21  	registries []*drone.Registry
    22  }
    23  
    24  func (p *static) List(context.Context, *Request) ([]*drone.Registry, error) {
    25  	return p.registries, nil
    26  }