bffv1beta1connect

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AuthServiceName is the fully-qualified name of the AuthService service.
	AuthServiceName = "lekko.bff.v1beta1.AuthService"
)
View Source
const (
	// BFFServiceName is the fully-qualified name of the BFFService service.
	BFFServiceName = "lekko.bff.v1beta1.BFFService"
)

Variables

This section is empty.

Functions

func NewAuthServiceHandler

func NewAuthServiceHandler(svc AuthServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)

NewAuthServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

func NewBFFServiceHandler

func NewBFFServiceHandler(svc BFFServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)

NewBFFServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type AuthServiceClient

type AuthServiceClient interface {
	// We will return required auth info in a cookie
	// that is sent to the same origin for other requests
	// inside the bff service.
	Login(context.Context, *connect_go.Request[v1beta1.LoginRequest]) (*connect_go.Response[v1beta1.LoginResponse], error)
	// Returns a response indicating if the account already
	// existed.
	RegisterUser(context.Context, *connect_go.Request[v1beta1.RegisterUserRequest]) (*connect_go.Response[v1beta1.RegisterUserResponse], error)
	// An rpc that a 3rd party device makes to our backend to obtain device and user
	// codes to complete device oauth.
	GetDeviceCode(context.Context, *connect_go.Request[v1beta1.GetDeviceCodeRequest]) (*connect_go.Response[v1beta1.GetDeviceCodeResponse], error)
	// An rpc that a 3rd party device polls to obtain an access token once
	// the user has completed authentication through a browser-based user agent.
	GetAccessToken(context.Context, *connect_go.Request[v1beta1.GetAccessTokenRequest]) (*connect_go.Response[v1beta1.GetAccessTokenResponse], error)
}

AuthServiceClient is a client for the lekko.bff.v1beta1.AuthService service.

func NewAuthServiceClient

func NewAuthServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) AuthServiceClient

NewAuthServiceClient constructs a client for the lekko.bff.v1beta1.AuthService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type AuthServiceHandler

type AuthServiceHandler interface {
	// We will return required auth info in a cookie
	// that is sent to the same origin for other requests
	// inside the bff service.
	Login(context.Context, *connect_go.Request[v1beta1.LoginRequest]) (*connect_go.Response[v1beta1.LoginResponse], error)
	// Returns a response indicating if the account already
	// existed.
	RegisterUser(context.Context, *connect_go.Request[v1beta1.RegisterUserRequest]) (*connect_go.Response[v1beta1.RegisterUserResponse], error)
	// An rpc that a 3rd party device makes to our backend to obtain device and user
	// codes to complete device oauth.
	GetDeviceCode(context.Context, *connect_go.Request[v1beta1.GetDeviceCodeRequest]) (*connect_go.Response[v1beta1.GetDeviceCodeResponse], error)
	// An rpc that a 3rd party device polls to obtain an access token once
	// the user has completed authentication through a browser-based user agent.
	GetAccessToken(context.Context, *connect_go.Request[v1beta1.GetAccessTokenRequest]) (*connect_go.Response[v1beta1.GetAccessTokenResponse], error)
}

AuthServiceHandler is an implementation of the lekko.bff.v1beta1.AuthService service.

type BFFServiceClient

type BFFServiceClient interface {
	// User management
	GetUserLoggedInInfo(context.Context, *connect_go.Request[v1beta1.GetUserLoggedInInfoRequest]) (*connect_go.Response[v1beta1.GetUserLoggedInInfoResponse], error)
	ChangePassword(context.Context, *connect_go.Request[v1beta1.ChangePasswordRequest]) (*connect_go.Response[v1beta1.ChangePasswordResponse], error)
	// Retrieves an oauth access token for the user, and stores in in the database
	OAuthUser(context.Context, *connect_go.Request[v1beta1.OAuthUserRequest]) (*connect_go.Response[v1beta1.OAuthUserResponse], error)
	GetUserOAuth(context.Context, *connect_go.Request[v1beta1.GetUserOAuthRequest]) (*connect_go.Response[v1beta1.GetUserOAuthResponse], error)
	AuthorizeDevice(context.Context, *connect_go.Request[v1beta1.AuthorizeDeviceRequest]) (*connect_go.Response[v1beta1.AuthorizeDeviceResponse], error)
	CreateTeam(context.Context, *connect_go.Request[v1beta1.CreateTeamRequest]) (*connect_go.Response[v1beta1.CreateTeamResponse], error)
	DeleteTeam(context.Context, *connect_go.Request[v1beta1.DeleteTeamRequest]) (*connect_go.Response[v1beta1.DeleteTeamResponse], error)
	UseTeam(context.Context, *connect_go.Request[v1beta1.UseTeamRequest]) (*connect_go.Response[v1beta1.UseTeamResponse], error)
	ListTeamMemberships(context.Context, *connect_go.Request[v1beta1.ListTeamMembershipsRequest]) (*connect_go.Response[v1beta1.ListTeamMembershipsResponse], error)
	ListUserMemberships(context.Context, *connect_go.Request[v1beta1.ListUserMembershipsRequest]) (*connect_go.Response[v1beta1.ListUserMembershipsResponse], error)
	UpsertMembership(context.Context, *connect_go.Request[v1beta1.UpsertMembershipRequest]) (*connect_go.Response[v1beta1.UpsertMembershipResponse], error)
	RemoveMembership(context.Context, *connect_go.Request[v1beta1.RemoveMembershipRequest]) (*connect_go.Response[v1beta1.RemoveMembershipResponse], error)
	CreateRepository(context.Context, *connect_go.Request[v1beta1.CreateRepositoryRequest]) (*connect_go.Response[v1beta1.CreateRepositoryResponse], error)
	DeleteRepository(context.Context, *connect_go.Request[v1beta1.DeleteRepositoryRequest]) (*connect_go.Response[v1beta1.DeleteRepositoryResponse], error)
	ListRepositories(context.Context, *connect_go.Request[v1beta1.ListRepositoriesRequest]) (*connect_go.Response[v1beta1.ListRepositoriesResponse], error)
	ListNamespaces(context.Context, *connect_go.Request[v1beta1.ListNamespacesRequest]) (*connect_go.Response[v1beta1.ListNamespacesResponse], error)
	// Lists all the features within a repository (and optionally, namespace)
	ListFeatures(context.Context, *connect_go.Request[v1beta1.ListFeaturesRequest]) (*connect_go.Response[v1beta1.ListFeaturesResponse], error)
	GetFeature(context.Context, *connect_go.Request[v1beta1.GetFeatureRequest]) (*connect_go.Response[v1beta1.GetFeatureResponse], error)
	// Get info about multiple PRs in a repository
	//
	// Deprecated: do not use.
	GetPRInfo(context.Context, *connect_go.Request[v1beta1.GetPRInfoRequest]) (*connect_go.Response[v1beta1.GetPRInfoResponse], error)
	// Get info about a single PR for the provided branch
	GetPR(context.Context, *connect_go.Request[v1beta1.GetPRRequest]) (*connect_go.Response[v1beta1.GetPRResponse], error)
	// Deprecated, use Merge instead
	//
	// Deprecated: do not use.
	MergePR(context.Context, *connect_go.Request[v1beta1.MergePRRequest]) (*connect_go.Response[v1beta1.MergePRResponse], error)
	CreateBranch(context.Context, *connect_go.Request[v1beta1.CreateBranchRequest]) (*connect_go.Response[v1beta1.CreateBranchResponse], error)
	ListBranches(context.Context, *connect_go.Request[v1beta1.ListBranchesRequest]) (*connect_go.Response[v1beta1.ListBranchesResponse], error)
	DeleteBranch(context.Context, *connect_go.Request[v1beta1.DeleteBranchRequest]) (*connect_go.Response[v1beta1.DeleteBranchResponse], error)
	// Saves a feature to the local repo, and runs compilation
	Save(context.Context, *connect_go.Request[v1beta1.SaveRequest]) (*connect_go.Response[v1beta1.SaveResponse], error)
	// Review opens a pull request against main using the currently committed changes.
	Review(context.Context, *connect_go.Request[v1beta1.ReviewRequest]) (*connect_go.Response[v1beta1.ReviewResponse], error)
	// Merges the pull request based on the given session.
	Merge(context.Context, *connect_go.Request[v1beta1.MergeRequest]) (*connect_go.Response[v1beta1.MergeResponse], error)
	// Evaluates the feature based on the given session.
	Eval(context.Context, *connect_go.Request[v1beta1.EvalRequest]) (*connect_go.Response[v1beta1.EvalResponse], error)
	GetFlagEvaluationMetrics(context.Context, *connect_go.Request[v1beta1.GetFlagEvaluationMetricsRequest]) (*connect_go.Response[v1beta1.GetFlagEvaluationMetricsResponse], error)
	// Performs a global restore of the repo, creating a dev session under the hood with the changes.
	Restore(context.Context, *connect_go.Request[v1beta1.RestoreRequest]) (*connect_go.Response[v1beta1.RestoreResponse], error)
	GetRepositoryLogs(context.Context, *connect_go.Request[v1beta1.GetRepositoryLogsRequest]) (*connect_go.Response[v1beta1.GetRepositoryLogsResponse], error)
	GetRollout(context.Context, *connect_go.Request[v1beta1.GetRolloutRequest]) (*connect_go.Response[v1beta1.GetRolloutResponse], error)
}

BFFServiceClient is a client for the lekko.bff.v1beta1.BFFService service.

func NewBFFServiceClient

func NewBFFServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) BFFServiceClient

NewBFFServiceClient constructs a client for the lekko.bff.v1beta1.BFFService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type BFFServiceHandler

type BFFServiceHandler interface {
	// User management
	GetUserLoggedInInfo(context.Context, *connect_go.Request[v1beta1.GetUserLoggedInInfoRequest]) (*connect_go.Response[v1beta1.GetUserLoggedInInfoResponse], error)
	ChangePassword(context.Context, *connect_go.Request[v1beta1.ChangePasswordRequest]) (*connect_go.Response[v1beta1.ChangePasswordResponse], error)
	// Retrieves an oauth access token for the user, and stores in in the database
	OAuthUser(context.Context, *connect_go.Request[v1beta1.OAuthUserRequest]) (*connect_go.Response[v1beta1.OAuthUserResponse], error)
	GetUserOAuth(context.Context, *connect_go.Request[v1beta1.GetUserOAuthRequest]) (*connect_go.Response[v1beta1.GetUserOAuthResponse], error)
	AuthorizeDevice(context.Context, *connect_go.Request[v1beta1.AuthorizeDeviceRequest]) (*connect_go.Response[v1beta1.AuthorizeDeviceResponse], error)
	CreateTeam(context.Context, *connect_go.Request[v1beta1.CreateTeamRequest]) (*connect_go.Response[v1beta1.CreateTeamResponse], error)
	DeleteTeam(context.Context, *connect_go.Request[v1beta1.DeleteTeamRequest]) (*connect_go.Response[v1beta1.DeleteTeamResponse], error)
	UseTeam(context.Context, *connect_go.Request[v1beta1.UseTeamRequest]) (*connect_go.Response[v1beta1.UseTeamResponse], error)
	ListTeamMemberships(context.Context, *connect_go.Request[v1beta1.ListTeamMembershipsRequest]) (*connect_go.Response[v1beta1.ListTeamMembershipsResponse], error)
	ListUserMemberships(context.Context, *connect_go.Request[v1beta1.ListUserMembershipsRequest]) (*connect_go.Response[v1beta1.ListUserMembershipsResponse], error)
	UpsertMembership(context.Context, *connect_go.Request[v1beta1.UpsertMembershipRequest]) (*connect_go.Response[v1beta1.UpsertMembershipResponse], error)
	RemoveMembership(context.Context, *connect_go.Request[v1beta1.RemoveMembershipRequest]) (*connect_go.Response[v1beta1.RemoveMembershipResponse], error)
	CreateRepository(context.Context, *connect_go.Request[v1beta1.CreateRepositoryRequest]) (*connect_go.Response[v1beta1.CreateRepositoryResponse], error)
	DeleteRepository(context.Context, *connect_go.Request[v1beta1.DeleteRepositoryRequest]) (*connect_go.Response[v1beta1.DeleteRepositoryResponse], error)
	ListRepositories(context.Context, *connect_go.Request[v1beta1.ListRepositoriesRequest]) (*connect_go.Response[v1beta1.ListRepositoriesResponse], error)
	ListNamespaces(context.Context, *connect_go.Request[v1beta1.ListNamespacesRequest]) (*connect_go.Response[v1beta1.ListNamespacesResponse], error)
	// Lists all the features within a repository (and optionally, namespace)
	ListFeatures(context.Context, *connect_go.Request[v1beta1.ListFeaturesRequest]) (*connect_go.Response[v1beta1.ListFeaturesResponse], error)
	GetFeature(context.Context, *connect_go.Request[v1beta1.GetFeatureRequest]) (*connect_go.Response[v1beta1.GetFeatureResponse], error)
	// Get info about multiple PRs in a repository
	//
	// Deprecated: do not use.
	GetPRInfo(context.Context, *connect_go.Request[v1beta1.GetPRInfoRequest]) (*connect_go.Response[v1beta1.GetPRInfoResponse], error)
	// Get info about a single PR for the provided branch
	GetPR(context.Context, *connect_go.Request[v1beta1.GetPRRequest]) (*connect_go.Response[v1beta1.GetPRResponse], error)
	// Deprecated, use Merge instead
	//
	// Deprecated: do not use.
	MergePR(context.Context, *connect_go.Request[v1beta1.MergePRRequest]) (*connect_go.Response[v1beta1.MergePRResponse], error)
	CreateBranch(context.Context, *connect_go.Request[v1beta1.CreateBranchRequest]) (*connect_go.Response[v1beta1.CreateBranchResponse], error)
	ListBranches(context.Context, *connect_go.Request[v1beta1.ListBranchesRequest]) (*connect_go.Response[v1beta1.ListBranchesResponse], error)
	DeleteBranch(context.Context, *connect_go.Request[v1beta1.DeleteBranchRequest]) (*connect_go.Response[v1beta1.DeleteBranchResponse], error)
	// Saves a feature to the local repo, and runs compilation
	Save(context.Context, *connect_go.Request[v1beta1.SaveRequest]) (*connect_go.Response[v1beta1.SaveResponse], error)
	// Review opens a pull request against main using the currently committed changes.
	Review(context.Context, *connect_go.Request[v1beta1.ReviewRequest]) (*connect_go.Response[v1beta1.ReviewResponse], error)
	// Merges the pull request based on the given session.
	Merge(context.Context, *connect_go.Request[v1beta1.MergeRequest]) (*connect_go.Response[v1beta1.MergeResponse], error)
	// Evaluates the feature based on the given session.
	Eval(context.Context, *connect_go.Request[v1beta1.EvalRequest]) (*connect_go.Response[v1beta1.EvalResponse], error)
	GetFlagEvaluationMetrics(context.Context, *connect_go.Request[v1beta1.GetFlagEvaluationMetricsRequest]) (*connect_go.Response[v1beta1.GetFlagEvaluationMetricsResponse], error)
	// Performs a global restore of the repo, creating a dev session under the hood with the changes.
	Restore(context.Context, *connect_go.Request[v1beta1.RestoreRequest]) (*connect_go.Response[v1beta1.RestoreResponse], error)
	GetRepositoryLogs(context.Context, *connect_go.Request[v1beta1.GetRepositoryLogsRequest]) (*connect_go.Response[v1beta1.GetRepositoryLogsResponse], error)
	GetRollout(context.Context, *connect_go.Request[v1beta1.GetRolloutRequest]) (*connect_go.Response[v1beta1.GetRolloutResponse], error)
}

BFFServiceHandler is an implementation of the lekko.bff.v1beta1.BFFService service.

type UnimplementedAuthServiceHandler

type UnimplementedAuthServiceHandler struct{}

UnimplementedAuthServiceHandler returns CodeUnimplemented from all methods.

type UnimplementedBFFServiceHandler

type UnimplementedBFFServiceHandler struct{}

UnimplementedBFFServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedBFFServiceHandler) GetPR added in v0.2.1

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL