deployment: throw away golanglint-ci defaults (#439)

* deployment: throw away golanglint-ci defaults

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
Bobby DeSimone 2020-01-26 12:33:45 -08:00 committed by GitHub
parent dd54ce4481
commit e82477ea5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 101 additions and 3 deletions

View file

@ -11,6 +11,7 @@ import (
"io/ioutil"
)
// CertifcateFromBase64 returns an X509 pair from a base64 encoded blob.
func CertifcateFromBase64(cert, key string) (*tls.Certificate, error) {
decodedCert, err := base64.StdEncoding.DecodeString(cert)
if err != nil {
@ -24,11 +25,15 @@ func CertifcateFromBase64(cert, key string) (*tls.Certificate, error) {
return &x509, err
}
// CertificateFromFile given a certificate, and key file path, returns a X509
// keypair.
func CertificateFromFile(certFile, keyFile string) (*tls.Certificate, error) {
cert, err := tls.LoadX509KeyPair(certFile, keyFile)
return &cert, err
}
// CertPoolFromBase64 takes a base64 encoded string and returns a new
// X509 certificate pool.
func CertPoolFromBase64(encPemCerts string) (*x509.CertPool, error) {
b, err := base64.StdEncoding.DecodeString(encPemCerts)
if err != nil {
@ -37,6 +42,7 @@ func CertPoolFromBase64(encPemCerts string) (*x509.CertPool, error) {
return bytesToCertPool(b)
}
// CertPoolFromFile reads a file and returns an X509 certificate pool.
func CertPoolFromFile(pemFile string) (*x509.CertPool, error) {
b, err := ioutil.ReadFile(pemFile)
if err != nil {

View file

@ -0,0 +1,3 @@
// Package cryptutil provides cryptographic utility functions, complementing the
// lower level abstractions found in the standard library.
package cryptutil // import "github.com/pomerium/pomerium/internal/cryptutil"

View file

@ -1,3 +1,5 @@
// Package encoding defines interfaces shared by other packages that
// convert data to and from byte-level and textual representations.
package encoding // import "github.com/pomerium/pomerium/internal/encoding"
// MarshalUnmarshaler can both Marshal and Unmarshal a struct into and from a set of bytes.

View file

@ -1,3 +1,4 @@
// Package mock implements a mock implementation of MarshalUnmarshaler.
package mock // import "github.com/pomerium/pomerium/internal/encoding/mock"
import (

View file

@ -1,3 +1,5 @@
// Package fileutil provides file utility functions, complementing the
// lower level abstractions found in the standard library.
package fileutil // import "github.com/pomerium/pomerium/internal/fileutil"
import (

View file

@ -1,5 +1,7 @@
//go:generate statik -src=./assets -include=*.svg,*.html,*.css,*.js
// Package frontend handles the generation, and instantiation of Pomerium's
// html templates.
package frontend // import "github.com/pomerium/pomerium/internal/frontend"
import (

View file

@ -1,3 +1,4 @@
// Package client implements a gRPC client for the authorization service.
package client
import (

View file

@ -1,3 +1,4 @@
// Package client implements a gRPC client for the cache service.
package client
import (

3
internal/grpc/docs.go Normal file
View file

@ -0,0 +1,3 @@
// Package grpc provides gRPC utility functions, complementing the more
// common ones in the github.com/grpc/grpc-go package
package grpc // import "github.com/pomerium/pomerium/internal/grpc"

2
internal/grpcutil/doc.go Normal file
View file

@ -0,0 +1,2 @@
// Package grpcutil contains utility functions for working with gRPC.
package grpcutil // import "github.com/pomerium/pomerium/internal/grpcutil"

View file

@ -0,0 +1,3 @@
// Package httputil provides HTTP utility functions, complementing the more
// common ones in the net/http package
package httputil // import "github.com/pomerium/pomerium/internal/httputil"

View file

@ -1,3 +1,6 @@
// Package autocache implements a key value store (kv.Store) using autocache
// which combines functionality from groupcache, and memberlist libraries.
// For more details, see https://github.com/pomerium/autocache
package autocache
import (

View file

@ -1,3 +1,5 @@
// Package bolt implements a key value store (kv.Store) using bbolt.
// For more details, see https://github.com/etcd-io/bbolt
package bolt
import (

View file

@ -1,3 +1,5 @@
// Package redis implements a key value store (kv.Store) using redis.
// For more details, see https://redis.io/
package redis
import (

View file

@ -1,3 +1,5 @@
// Package kv defines a Store interfaces that can be implemented by
// datastores to provide key value storage capabilities.
package kv
import "context"

View file

@ -1,3 +1,5 @@
// Package responsewriter contains helper functions that useful for
// hooking into various parts of a response.
package responsewriter
// The original work was derived from Goji's middleware, source:

View file

@ -1,3 +1,5 @@
// Package cache provides a remote cache based implementation of session store
// and loader. See pomerium's cache service for more details.
package cache // import "github.com/pomerium/pomerium/internal/sessions/cache"
import (

View file

@ -1,3 +1,4 @@
// Package cookie provides a cookie based implementation of session store and loader.
package cookie // import "github.com/pomerium/pomerium/internal/sessions/cookie"
import (

View file

@ -1,3 +1,5 @@
// Package header provides a request header based implementation of a
// session loader.
package header // import "github.com/pomerium/pomerium/internal/sessions/header"
import (

View file

@ -1,3 +1,4 @@
// Package mock provides a mock implementation of session store and loader.
package mock // import "github.com/pomerium/pomerium/internal/sessions/mock"
import (

View file

@ -1,3 +1,5 @@
// Package queryparam provides a query param based implementation of a both
// as session store and loader.
package queryparam // import "github.com/pomerium/pomerium/internal/sessions/queryparam"
import (

View file

@ -1,3 +1,5 @@
// Package sessions handles the storage, management, and validation
// of pomerium user sessions.
package sessions // import "github.com/pomerium/pomerium/internal/sessions"
import (

View file

@ -0,0 +1,2 @@
// Package metrics contains support for OpenCensus distributed metrics.
package metrics // import "github.com/pomerium/pomerium/internal/telemetry/metrics"

View file

@ -154,7 +154,7 @@ func SetBuildInfo(service string) {
registry.setBuildInfo(service)
}
// Register non-view based metrics registry globally for export
// RegisterInfoMetrics registers non-view based metrics registry globally for export
func RegisterInfoMetrics() {
metricproducer.GlobalManager().AddProducer(registry.registry)
}

View file

@ -0,0 +1,2 @@
// Package trace contains support for OpenCensus distributed tracing.
package trace // import "github.com/pomerium/pomerium/internal/telemetry/trace"

View file

@ -11,6 +11,7 @@ import (
)
const (
// JaegerTracingProviderName is the name of the tracing provider Jaeger.
JaegerTracingProviderName = "jaeger"
)
@ -31,6 +32,7 @@ type TracingOptions struct {
JaegerAgentEndpoint string `mapstructure:"tracing_jaeger_agent_endpoint"`
}
// RegisterTracing creates a new trace exporter from TracingOptions.
func RegisterTracing(opts *TracingOptions) error {
var err error
switch opts.Provider {

View file

@ -1,3 +1,5 @@
// Package tripper provides utility functions for working with the
// http.RoundTripper interface.
package tripper // import "github.com/pomerium/pomerium/internal/tripper"
import (

View file

@ -1,3 +1,4 @@
// Package urlutil provides utility functions for working with go urls.
package urlutil // import "github.com/pomerium/pomerium/internal/urlutil"
import (
@ -60,6 +61,7 @@ func ValidateURL(u *url.URL) error {
return nil
}
// DeepCopy creates a deep copy of a *url.URL
func DeepCopy(u *url.URL) (*url.URL, error) {
if u == nil {
return nil, nil

View file

@ -1,3 +1,4 @@
// Package version enables setting build-time version using ldflags.
package version // import "github.com/pomerium/pomerium/internal/version"
import (