Documentation ¶
Index ¶
- func BuildCmd[T server.ConfigType[T], G server.GetRequestType, S server.SetRequestType[T], ...](use string, cci I, dryRunnableCmds ...*cobra.Command) *cobra.Command
- func NewDryRunClientShim[T server.ConfigType[T], G server.GetRequestType, S server.SetRequestType[T], ...](dr *DryRunClient[T, G, S, R, D, DR, H, HR, C], ...) grpc.ClientConnInterface
- type DryRunClient
- func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) AsClientConn(cci server.ClientContextInjector[C]) grpc.ClientConnInterface
- func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) DryRun(_ context.Context, _ D, _ ...grpc.CallOption) (DR, error)
- func (*DryRunClient[T, G, S, R, D, DR, H, HR, C]) FromClientConn(cc grpc.ClientConnInterface) *DryRunClient[T, G, S, R, D, DR, H, HR, C]
- func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) Get(ctx context.Context, in G, opts ...grpc.CallOption) (T, error)
- func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) GetDefault(ctx context.Context, in G, opts ...grpc.CallOption) (T, error)
- func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) History(_ context.Context, _ H, _ ...grpc.CallOption) (HR, error)
- func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) Reset(ctx context.Context, req R, opts ...grpc.CallOption) (*emptypb.Empty, error)
- func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) ResetDefault(ctx context.Context, _ *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
- func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) Response() DR
- func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) Set(ctx context.Context, in S, opts ...grpc.CallOption) (*emptypb.Empty, error)
- func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) SetDefault(ctx context.Context, in S, opts ...grpc.CallOption) (*emptypb.Empty, error)
- type DryRunClientShim
- type DryRunRequestBuilder
- type DryRunRequestBuilder_Active
- type DryRunRequestBuilder_Build
- type DryRunRequestBuilder_Default
- type DryRunRequestBuilder_Reset
- type DryRunRequestBuilder_ResetOrBuild
- type DryRunRequestBuilder_Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCmd ¶
func BuildCmd[ T server.ConfigType[T], G server.GetRequestType, S server.SetRequestType[T], R server.ResetRequestType[T], D server.DryRunRequestType[T], DR server.DryRunResponseType[T], H server.HistoryRequestType, HR server.HistoryResponseType[T], I server.ClientContextInjector[C], C interface { server.GetClient[T, G] server.SetClient[T, S] server.ResetClient[T, R] server.DryRunClient[T, D, DR] server.HistoryClient[T, H, HR] }, ](use string, cci I, dryRunnableCmds ...*cobra.Command) *cobra.Command
Creates the 'dry-run' command for a compatible generated service client.
The compiler can resolve all type parameters given the generated ClientContextInjector; it should not be necessary to specify them manually.
The ClientContextInjector will be generated for any protobuf file containing the file option `option (cli.generator).generate = true;` and a compatible service definition.
In a separate file in the same package as the generated code, enable the dry-run command as follows, substituting "X" for your service name:
func init() { addExtraXCmd(dryrun.BuildCmd("dry-run", XContextInjector), BuildXSetDefaultCmd(), BuildXSetCmd(), BuildXResetDefaultCmd(), BuildXResetCmd(), ) }
The use line is the name of the dry-run command. If it is intended to be a generated subcommand, it can be multiple words (e.g. "config dry-run").
Once the dry-run command is enabled, it will be available in the CLI as a subcommand of the service's top-level command. For example, (assuming the service's use line is "config"):
$ <cmd> x config set [--flags ...] $ <cmd> x config dry-run set [--flags ...] $ <cmd> x config reset [--flags ...] $ <cmd> x config dry-run reset [--flags ...] etc.
func NewDryRunClientShim ¶
func NewDryRunClientShim[ T server.ConfigType[T], G server.GetRequestType, S server.SetRequestType[T], R server.ResetRequestType[T], D server.DryRunRequestType[T], DR server.DryRunResponseType[T], H server.HistoryRequestType, HR server.HistoryResponseType[T], C interface { server.GetClient[T, G] server.SetClient[T, S] server.ResetClient[T, R] server.DryRunClient[T, D, DR] server.HistoryClient[T, H, HR] }, ]( dr *DryRunClient[T, G, S, R, D, DR, H, HR, C], cci server.ClientContextInjector[C], ) grpc.ClientConnInterface
Types ¶
type DryRunClient ¶
type DryRunClient[ T server.ConfigType[T], G server.GetRequestType, S server.SetRequestType[T], R server.ResetRequestType[T], D server.DryRunRequestType[T], DR server.DryRunResponseType[T], H server.HistoryRequestType, HR server.HistoryResponseType[T], C interface { server.GetClient[T, G] server.SetClient[T, S] server.ResetClient[T, R] server.DryRunClient[T, D, DR] server.HistoryClient[T, H, HR] }, ] struct { // contains filtered or unexported fields }
func NewDryRunClient ¶
func NewDryRunClient[ T server.ConfigType[T], G server.GetRequestType, S server.SetRequestType[T], R server.ResetRequestType[T], D server.DryRunRequestType[T], DR server.DryRunResponseType[T], H server.HistoryRequestType, HR server.HistoryResponseType[T], C interface { server.GetClient[T, G] server.SetClient[T, S] server.ResetClient[T, R] server.DryRunClient[T, D, DR] server.HistoryClient[T, H, HR] }, ](client C) *DryRunClient[T, G, S, R, D, DR, H, HR, C]
func (*DryRunClient[T, G, S, R, D, DR, H, HR, C]) AsClientConn ¶
func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) AsClientConn(cci server.ClientContextInjector[C]) grpc.ClientConnInterface
func (*DryRunClient[T, G, S, R, D, DR, H, HR, C]) DryRun ¶
func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) DryRun(_ context.Context, _ D, _ ...grpc.CallOption) (DR, error)
DryRun implements server.DryRunClient[T, D, DR].
func (*DryRunClient[T, G, S, R, D, DR, H, HR, C]) FromClientConn ¶
func (*DryRunClient[T, G, S, R, D, DR, H, HR, C]) FromClientConn(cc grpc.ClientConnInterface) *DryRunClient[T, G, S, R, D, DR, H, HR, C]
func (*DryRunClient[T, G, S, R, D, DR, H, HR, C]) Get ¶
func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) Get(ctx context.Context, in G, opts ...grpc.CallOption) (T, error)
Get implements server.GetClient[T, G].
func (*DryRunClient[T, G, S, R, D, DR, H, HR, C]) GetDefault ¶
func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) GetDefault(ctx context.Context, in G, opts ...grpc.CallOption) (T, error)
GetDefault implements server.GetClient[T, G].
func (*DryRunClient[T, G, S, R, D, DR, H, HR, C]) History ¶
func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) History(_ context.Context, _ H, _ ...grpc.CallOption) (HR, error)
History implements server.HistoryClient[T, H, HR].
func (*DryRunClient[T, G, S, R, D, DR, H, HR, C]) Reset ¶
func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) Reset(ctx context.Context, req R, opts ...grpc.CallOption) (*emptypb.Empty, error)
Reset implements server.GetClient[T, G].
func (*DryRunClient[T, G, S, R, D, DR, H, HR, C]) ResetDefault ¶
func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) ResetDefault(ctx context.Context, _ *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
ResetDefault implements server.ResetClient[T, R].
func (*DryRunClient[T, G, S, R, D, DR, H, HR, C]) Response ¶
func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) Response() DR
func (*DryRunClient[T, G, S, R, D, DR, H, HR, C]) Set ¶
func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) Set(ctx context.Context, in S, opts ...grpc.CallOption) (*emptypb.Empty, error)
Set implements server.SetClient[T, S].
func (*DryRunClient[T, G, S, R, D, DR, H, HR, C]) SetDefault ¶
func (dc *DryRunClient[T, G, S, R, D, DR, H, HR, C]) SetDefault(ctx context.Context, in S, opts ...grpc.CallOption) (*emptypb.Empty, error)
SetDefault implements server.SetClient[T, S].
type DryRunClientShim ¶
type DryRunClientShim[ T server.ConfigType[T], G server.GetRequestType, S server.SetRequestType[T], R server.ResetRequestType[T], D server.DryRunRequestType[T], DR server.DryRunResponseType[T], H server.HistoryRequestType, HR server.HistoryResponseType[T], C interface { server.GetClient[T, G] server.SetClient[T, S] server.ResetClient[T, R] server.DryRunClient[T, D, DR] server.HistoryClient[T, H, HR] }, ] struct { // contains filtered or unexported fields }
func (*DryRunClientShim[T, G, S, R, D, DR, H, HR, C]) Invoke ¶
func (dc *DryRunClientShim[T, G, S, R, D, DR, H, HR, C]) Invoke(ctx context.Context, method string, args any, reply any, opts ...grpc.CallOption) error
Invoke implements grpc.ClientConnInterface.
func (*DryRunClientShim[T, G, S, R, D, DR, H, HR, C]) NewStream ¶
func (dc *DryRunClientShim[T, G, S, R, D, DR, H, HR, C]) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)
NewStream implements grpc.ClientConnInterface.
type DryRunRequestBuilder ¶
type DryRunRequestBuilder[ T server.ConfigType[T], D server.DryRunRequestType[T], ] interface { Default() DryRunRequestBuilder_Default[T, D] Active() DryRunRequestBuilder_Active[T, D] }
func NewDryRunRequest ¶
func NewDryRunRequest[ T server.ConfigType[T], D server.DryRunRequestType[T], ]() DryRunRequestBuilder[T, D]
type DryRunRequestBuilder_Active ¶
type DryRunRequestBuilder_Active[ T server.ConfigType[T], D server.DryRunRequestType[T], ] interface { Set() DryRunRequestBuilder_Set[T, D] Reset() DryRunRequestBuilder_Reset[T, D] }
type DryRunRequestBuilder_Build ¶
type DryRunRequestBuilder_Build[ T server.ConfigType[T], D server.DryRunRequestType[T], ] interface { Build() D }
type DryRunRequestBuilder_Default ¶
type DryRunRequestBuilder_Default[ T server.ConfigType[T], D server.DryRunRequestType[T], ] interface { Set() DryRunRequestBuilder_Set[T, D] Reset() DryRunRequestBuilder_Build[T, D] }
type DryRunRequestBuilder_Reset ¶
type DryRunRequestBuilder_Reset[ T server.ConfigType[T], D server.DryRunRequestType[T], ] interface { Revision(rev *corev1.Revision) DryRunRequestBuilder_ResetOrBuild[T, D] Patch(patch T) DryRunRequestBuilder_ResetOrBuild[T, D] Mask(mask *fieldmaskpb.FieldMask) DryRunRequestBuilder_ResetOrBuild[T, D] }
type DryRunRequestBuilder_ResetOrBuild ¶
type DryRunRequestBuilder_ResetOrBuild[ T server.ConfigType[T], D server.DryRunRequestType[T], ] interface { DryRunRequestBuilder_Reset[T, D] DryRunRequestBuilder_Build[T, D] }
type DryRunRequestBuilder_Set ¶
type DryRunRequestBuilder_Set[ T server.ConfigType[T], D server.DryRunRequestType[T], ] interface { Spec(spec T) DryRunRequestBuilder_Build[T, D] }