Documentation ¶
Index ¶
- Constants
- Variables
- func AuthEnabled() bool
- func MatchGRPCError(code interface{}, err interface{}) types.GomegaMatcher
- func NewApplicationsServer(cfg *ApplicationsConfig, setters ...ApplicationsOption) pb.ApplicationsServer
- func NewHandlers(ctx context.Context, cfg *Config) (http.Handler, error)
- func NewProfilesServer(config ProfilesConfig) pb.ProfilesServer
- type ApplicationsConfig
- type ApplicationsOption
- type ApplicationsOptions
- type ClientGetter
- type ClusterConfig
- type Config
- type ConfigGetter
- type DefaultClientGetter
- type DefaultFetcherFactory
- type FetcherFactory
- type ImpersonatingConfigGetter
- type ProfilesConfig
- type ProfilesServer
Constants ¶
const ( OctetStreamType = "application/octet-stream" JsonType = "application/json" )
const (
AuthEnabledFeatureFlag = "WEAVE_GITOPS_AUTH_ENABLED"
)
const DefaultPort = "9001"
Variables ¶
var ( ErrEmptyAccessToken = errors.New("access token is empty") ErrBadProvider = errors.New("wrong provider name") )
var ( KustomizeNameKey = fmt.Sprintf("%s/name", kustomizev2.GroupVersion.Group) KustomizeNamespaceKey = fmt.Sprintf("%s/namespace", kustomizev2.GroupVersion.Group) HelmNameKey = fmt.Sprintf("%s/name", helmv2.GroupVersion.Group) HelmNamespaceKey = fmt.Sprintf("%s/namespace", helmv2.GroupVersion.Group) )
Flux owner labels
Functions ¶
func AuthEnabled ¶ added in v0.6.1
func AuthEnabled() bool
func MatchGRPCError ¶ added in v0.2.5
func MatchGRPCError(code interface{}, err interface{}) types.GomegaMatcher
func NewApplicationsServer ¶
func NewApplicationsServer(cfg *ApplicationsConfig, setters ...ApplicationsOption) pb.ApplicationsServer
NewApplicationsServer creates a grpc Applications server
func NewHandlers ¶ added in v0.6.0
func NewProfilesServer ¶ added in v0.6.0
func NewProfilesServer(config ProfilesConfig) pb.ProfilesServer
Types ¶
type ApplicationsConfig ¶ added in v0.2.3
type ApplicationsConfig struct { Logger logr.Logger Factory services.Factory JwtClient auth.JWTClient GithubAuthClient auth.GithubAuthClient FetcherFactory FetcherFactory GitlabAuthClient auth.GitlabAuthClient ClusterConfig ClusterConfig }
An ApplicationsConfig allows for the customization of an ApplicationsServer. Use the DefaultConfig() to use the default dependencies.
func DefaultApplicationsConfig ¶ added in v0.6.0
func DefaultApplicationsConfig() (*ApplicationsConfig, error)
DefaultApplicationsConfig creates a populated config with the dependencies for a Server
type ApplicationsOption ¶ added in v0.6.1
type ApplicationsOption func(*ApplicationsOptions)
ApplicationsOption defines the signature of a function that can be used to set an option for an ApplicationsServer.
func WithClientGetter ¶ added in v0.6.1
func WithClientGetter(clientGetter ClientGetter) ApplicationsOption
WithClientGetter allows for setting a ClientGetter.
type ApplicationsOptions ¶ added in v0.6.1
type ApplicationsOptions struct {
ClientGetter ClientGetter
}
ApplicationsOptions includes all the options that can be set for an ApplicationsServer.
type ClientGetter ¶ added in v0.6.1
ClientGetter implementations should create a Kubernetes client from a context.
type ClusterConfig ¶ added in v0.6.1
ClusterConfig is used to hold the default *rest.Config and the cluster name.
type Config ¶ added in v0.6.0
type Config struct { AppConfig *ApplicationsConfig AppOptions []ApplicationsOption ProfilesConfig ProfilesConfig AuthServer *auth.AuthServer }
type ConfigGetter ¶ added in v0.6.1
ConfigGetter implementations should extract the details from a context and create a *rest.Config for use in clients.
type DefaultClientGetter ¶ added in v0.6.1
type DefaultClientGetter struct {
// contains filtered or unexported fields
}
DefaultClientGetter implements the ClientGetter interface and uses a ConfigGetter to get a *rest.Config and create a Kubernetes client.
type DefaultFetcherFactory ¶ added in v0.6.1
type DefaultFetcherFactory struct { }
DefaultFetcherFactory creates applicationv2.Fetcher objects from a Kubernetes client
func (*DefaultFetcherFactory) Create ¶ added in v0.6.1
func (f *DefaultFetcherFactory) Create(client client.Client) applicationv2.Fetcher
Create uses a Kubernetes client to create an applicationv2.Fetcher object.
type FetcherFactory ¶ added in v0.6.1
type FetcherFactory interface {
Create(client client.Client) applicationv2.Fetcher
}
FetcherFactory implementations should create applicationv2.Fetcher objects from a Kubernetes client.
func NewDefaultFetcherFactory ¶ added in v0.6.1
func NewDefaultFetcherFactory() FetcherFactory
NewDefaultFetcherFactory returns a new DefaultFetcherFactory
type ImpersonatingConfigGetter ¶ added in v0.6.1
type ImpersonatingConfigGetter struct {
// contains filtered or unexported fields
}
ImpersonatingConfigGetter is an implementation of the ConfigGetter interface that returns configs based on a base one. It inspects the context for a principal and if it finds one, it configures the *rest.Config to impersonate that principal. Otherwise it returns a copy of the base config.
func NewImpersonatingConfigGetter ¶ added in v0.6.1
func NewImpersonatingConfigGetter(cfg *rest.Config, insecure bool) *ImpersonatingConfigGetter
NewImpersonatingConfigGetter creates and returns a ConfigGetter with a known config.
type ProfilesConfig ¶ added in v0.6.0
type ProfilesConfig struct {
// contains filtered or unexported fields
}
func NewProfilesConfig ¶ added in v0.6.0
type ProfilesServer ¶ added in v0.6.0
type ProfilesServer struct { pb.UnimplementedProfilesServer KubeClient client.Client Log logr.Logger HelmRepoName string HelmRepoNamespace string HelmCache cache.Cache }
func (*ProfilesServer) GetProfileValues ¶ added in v0.6.0
func (s *ProfilesServer) GetProfileValues(ctx context.Context, msg *pb.GetProfileValuesRequest) (*httpbody.HttpBody, error)
func (*ProfilesServer) GetProfiles ¶ added in v0.6.0
func (s *ProfilesServer) GetProfiles(ctx context.Context, msg *pb.GetProfilesRequest) (*pb.GetProfilesResponse, error)