api

package
v6.49.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestServiceCLICommand

func NewTestServiceCLICommand() *cobra.Command

func NewTestServiceCLICommandWithClientProvider

func NewTestServiceCLICommandWithClientProvider(clientProvider CLITestServiceClientProvider) *cobra.Command

func RegisterRoutesTestService

func RegisterRoutesTestService(router wrouter.Router, impl TestService, routerParams ...wrouter.RouteParam) error

RegisterRoutesTestService registers handlers for the TestService endpoints with a witchcraft wrouter. This should typically be called in a witchcraft server's InitFunc. impl provides an implementation of each endpoint, which can assume the request parameters have been parsed in accordance with the Conjure specification.

Types

type CLIConfig

type CLIConfig struct {
	Client httpclient.ClientConfig `yaml:",inline"`
}

type CLITestServiceClientProvider

type CLITestServiceClientProvider interface {
	Get(ctx context.Context, flags *pflag.FlagSet) (TestServiceClient, error)
}

func NewDefaultCLITestServiceClientProvider

func NewDefaultCLITestServiceClientProvider() CLITestServiceClientProvider

type CustomEnum added in v6.20.0

type CustomEnum struct {
	// contains filtered or unexported fields
}

func New_CustomEnum added in v6.20.0

func New_CustomEnum(value CustomEnum_Value) CustomEnum

func (CustomEnum) IsUnknown added in v6.20.0

func (e CustomEnum) IsUnknown() bool

IsUnknown returns false for all known variants of CustomEnum and true otherwise.

func (CustomEnum) MarshalText added in v6.20.0

func (e CustomEnum) MarshalText() ([]byte, error)

func (CustomEnum) String added in v6.20.0

func (e CustomEnum) String() string

func (*CustomEnum) UnmarshalText added in v6.20.0

func (e *CustomEnum) UnmarshalText(data []byte) error

func (CustomEnum) Value added in v6.20.0

func (e CustomEnum) Value() CustomEnum_Value

type CustomEnum_Value added in v6.20.0

type CustomEnum_Value string
const (
	CustomEnum_STATE1  CustomEnum_Value = "STATE1"
	CustomEnum_STATE2  CustomEnum_Value = "STATE2"
	CustomEnum_UNKNOWN CustomEnum_Value = "UNKNOWN"
)

func CustomEnum_Values added in v6.20.0

func CustomEnum_Values() []CustomEnum_Value

CustomEnum_Values returns all known variants of CustomEnum.

type CustomObject

type CustomObject struct {
	Data []byte `json:"data"`
}

func (CustomObject) MarshalYAML

func (o CustomObject) MarshalYAML() (interface{}, error)

func (*CustomObject) UnmarshalYAML

func (o *CustomObject) UnmarshalYAML(unmarshal func(interface{}) error) error

type CustomUnion added in v6.20.0

type CustomUnion struct {
	// contains filtered or unexported fields
}

func NewCustomUnionFromAsInteger added in v6.20.0

func NewCustomUnionFromAsInteger(v int) CustomUnion

func NewCustomUnionFromAsString added in v6.20.0

func NewCustomUnionFromAsString(v string) CustomUnion

func (*CustomUnion) Accept added in v6.20.0

func (u *CustomUnion) Accept(v CustomUnionVisitor) error

func (*CustomUnion) AcceptFuncs added in v6.20.0

func (u *CustomUnion) AcceptFuncs(asStringFunc func(string) error, asIntegerFunc func(int) error, unknownFunc func(string) error) error

func (*CustomUnion) AcceptWithContext added in v6.20.0

func (u *CustomUnion) AcceptWithContext(ctx context.Context, v CustomUnionVisitorWithContext) error

func (*CustomUnion) AsIntegerNoopSuccess added in v6.20.0

func (u *CustomUnion) AsIntegerNoopSuccess(int) error

func (*CustomUnion) AsStringNoopSuccess added in v6.20.0

func (u *CustomUnion) AsStringNoopSuccess(string) error

func (*CustomUnion) ErrorOnUnknown added in v6.20.0

func (u *CustomUnion) ErrorOnUnknown(typeName string) error

func (CustomUnion) MarshalJSON added in v6.20.0

func (u CustomUnion) MarshalJSON() ([]byte, error)

func (CustomUnion) MarshalYAML added in v6.20.0

func (u CustomUnion) MarshalYAML() (interface{}, error)

func (*CustomUnion) UnmarshalJSON added in v6.20.0

func (u *CustomUnion) UnmarshalJSON(data []byte) error

func (*CustomUnion) UnmarshalYAML added in v6.20.0

func (u *CustomUnion) UnmarshalYAML(unmarshal func(interface{}) error) error

type CustomUnionVisitor added in v6.20.0

type CustomUnionVisitor interface {
	VisitAsString(v string) error
	VisitAsInteger(v int) error
	VisitUnknown(typeName string) error
}

type CustomUnionVisitorWithContext added in v6.20.0

type CustomUnionVisitorWithContext interface {
	VisitAsStringWithContext(ctx context.Context, v string) error
	VisitAsIntegerWithContext(ctx context.Context, v int) error
	VisitUnknownWithContext(ctx context.Context, typeName string) error
}

type CustomUnionVisitorWithT added in v6.20.0

type CustomUnionVisitorWithT[T any] interface {
	VisitAsString(ctx context.Context, v string) (T, error)
	VisitAsInteger(ctx context.Context, v int) (T, error)
	VisitUnknown(ctx context.Context, typ string) (T, error)
}

type CustomUnionWithT added in v6.20.0

type CustomUnionWithT[T any] CustomUnion

func (*CustomUnionWithT[T]) Accept added in v6.20.0

func (u *CustomUnionWithT[T]) Accept(ctx context.Context, v CustomUnionVisitorWithT[T]) (T, error)

type OptionalIntegerAlias

type OptionalIntegerAlias struct {
	Value *int
}

func (OptionalIntegerAlias) MarshalJSON

func (a OptionalIntegerAlias) MarshalJSON() ([]byte, error)

func (OptionalIntegerAlias) MarshalYAML

func (a OptionalIntegerAlias) MarshalYAML() (interface{}, error)

func (*OptionalIntegerAlias) UnmarshalJSON

func (a *OptionalIntegerAlias) UnmarshalJSON(data []byte) error

func (*OptionalIntegerAlias) UnmarshalYAML

func (a *OptionalIntegerAlias) UnmarshalYAML(unmarshal func(interface{}) error) error

type OptionalListAlias

type OptionalListAlias struct {
	Value *[]string
}

func (OptionalListAlias) MarshalJSON

func (a OptionalListAlias) MarshalJSON() ([]byte, error)

func (OptionalListAlias) MarshalYAML

func (a OptionalListAlias) MarshalYAML() (interface{}, error)

func (*OptionalListAlias) UnmarshalJSON

func (a *OptionalListAlias) UnmarshalJSON(data []byte) error

func (*OptionalListAlias) UnmarshalYAML

func (a *OptionalListAlias) UnmarshalYAML(unmarshal func(interface{}) error) error

type StringAlias

type StringAlias string

type TestService

type TestService interface {
	Echo(ctx context.Context, cookieToken bearertoken.Token) error
	// These are some endpoint docs
	EchoStrings(ctx context.Context, bodyArg []string) ([]string, error)
	EchoCustomObject(ctx context.Context, bodyArg *CustomObject) (*CustomObject, error)
	EchoOptionalAlias(ctx context.Context, bodyArg OptionalIntegerAlias) (OptionalIntegerAlias, error)
	EchoOptionalListAlias(ctx context.Context, bodyArg OptionalListAlias) (OptionalListAlias, error)
	GetPathParam(ctx context.Context, authHeader bearertoken.Token, myPathParamArg string) error
	GetListBoolean(ctx context.Context, myQueryParam1Arg []bool) ([]bool, error)
	PutMapStringString(ctx context.Context, myParamArg map[string]string) (map[string]string, error)
	PutMapStringAny(ctx context.Context, myParamArg map[string]interface{}) (map[string]interface{}, error)
	GetDateTime(ctx context.Context, myParamArg datetime.DateTime) (datetime.DateTime, error)
	GetDouble(ctx context.Context, myParamArg float64) (float64, error)
	GetRid(ctx context.Context, myParamArg rid.ResourceIdentifier) (rid.ResourceIdentifier, error)
	GetSafeLong(ctx context.Context, myParamArg safelong.SafeLong) (safelong.SafeLong, error)
	GetUuid(ctx context.Context, myParamArg uuid.UUID) (uuid.UUID, error)
	GetEnum(ctx context.Context, myParamArg CustomEnum) (CustomEnum, error)
	PutBinary(ctx context.Context, myParamArg io.ReadCloser) (io.ReadCloser, error)
	GetOptionalBinary(ctx context.Context) (*io.ReadCloser, error)
	PutCustomUnion(ctx context.Context, myParamArg CustomUnion) (CustomUnion, error)
	// An endpoint that uses reserved flag names
	GetReserved(ctx context.Context, confArg string, bearertokenArg string) error
	// An endpoint that uses go keywords
	Chan(ctx context.Context, varArg string, importArg map[string]string, typeArg string, returnArg safelong.SafeLong, httpArg string, jsonArg string, reqArg string, rwArg string) error
}

type TestServiceCLICommand

type TestServiceCLICommand struct {
	// contains filtered or unexported fields
}

type TestServiceClient

type TestServiceClient interface {
	Echo(ctx context.Context, cookieToken bearertoken.Token) error
	// These are some endpoint docs
	EchoStrings(ctx context.Context, bodyArg []string) ([]string, error)
	EchoCustomObject(ctx context.Context, bodyArg *CustomObject) (*CustomObject, error)
	EchoOptionalAlias(ctx context.Context, bodyArg OptionalIntegerAlias) (OptionalIntegerAlias, error)
	EchoOptionalListAlias(ctx context.Context, bodyArg OptionalListAlias) (OptionalListAlias, error)
	GetPathParam(ctx context.Context, authHeader bearertoken.Token, myPathParamArg string) error
	GetListBoolean(ctx context.Context, myQueryParam1Arg []bool) ([]bool, error)
	PutMapStringString(ctx context.Context, myParamArg map[string]string) (map[string]string, error)
	PutMapStringAny(ctx context.Context, myParamArg map[string]interface{}) (map[string]interface{}, error)
	GetDateTime(ctx context.Context, myParamArg datetime.DateTime) (datetime.DateTime, error)
	GetDouble(ctx context.Context, myParamArg float64) (float64, error)
	GetRid(ctx context.Context, myParamArg rid.ResourceIdentifier) (rid.ResourceIdentifier, error)
	GetSafeLong(ctx context.Context, myParamArg safelong.SafeLong) (safelong.SafeLong, error)
	GetUuid(ctx context.Context, myParamArg uuid.UUID) (uuid.UUID, error)
	GetEnum(ctx context.Context, myParamArg CustomEnum) (CustomEnum, error)
	PutBinary(ctx context.Context, myParamArg func() io.ReadCloser) (io.ReadCloser, error)
	GetOptionalBinary(ctx context.Context) (*io.ReadCloser, error)
	PutCustomUnion(ctx context.Context, myParamArg CustomUnion) (CustomUnion, error)
	// An endpoint that uses reserved flag names
	GetReserved(ctx context.Context, confArg string, bearertokenArg string) error
	// An endpoint that uses go keywords
	Chan(ctx context.Context, varArg string, importArg map[string]string, typeArg string, returnArg safelong.SafeLong, httpArg string, jsonArg string, reqArg string, rwArg string) error
}

func NewTestServiceClient

func NewTestServiceClient(client httpclient.Client) TestServiceClient

type TestServiceClientWithAuth

type TestServiceClientWithAuth interface {
	Echo(ctx context.Context) error
	// These are some endpoint docs
	EchoStrings(ctx context.Context, bodyArg []string) ([]string, error)
	EchoCustomObject(ctx context.Context, bodyArg *CustomObject) (*CustomObject, error)
	EchoOptionalAlias(ctx context.Context, bodyArg OptionalIntegerAlias) (OptionalIntegerAlias, error)
	EchoOptionalListAlias(ctx context.Context, bodyArg OptionalListAlias) (OptionalListAlias, error)
	GetPathParam(ctx context.Context, myPathParamArg string) error
	GetListBoolean(ctx context.Context, myQueryParam1Arg []bool) ([]bool, error)
	PutMapStringString(ctx context.Context, myParamArg map[string]string) (map[string]string, error)
	PutMapStringAny(ctx context.Context, myParamArg map[string]interface{}) (map[string]interface{}, error)
	GetDateTime(ctx context.Context, myParamArg datetime.DateTime) (datetime.DateTime, error)
	GetDouble(ctx context.Context, myParamArg float64) (float64, error)
	GetRid(ctx context.Context, myParamArg rid.ResourceIdentifier) (rid.ResourceIdentifier, error)
	GetSafeLong(ctx context.Context, myParamArg safelong.SafeLong) (safelong.SafeLong, error)
	GetUuid(ctx context.Context, myParamArg uuid.UUID) (uuid.UUID, error)
	GetEnum(ctx context.Context, myParamArg CustomEnum) (CustomEnum, error)
	PutBinary(ctx context.Context, myParamArg func() io.ReadCloser) (io.ReadCloser, error)
	GetOptionalBinary(ctx context.Context) (*io.ReadCloser, error)
	PutCustomUnion(ctx context.Context, myParamArg CustomUnion) (CustomUnion, error)
	// An endpoint that uses reserved flag names
	GetReserved(ctx context.Context, confArg string, bearertokenArg string) error
	// An endpoint that uses go keywords
	Chan(ctx context.Context, varArg string, importArg map[string]string, typeArg string, returnArg safelong.SafeLong, httpArg string, jsonArg string, reqArg string, rwArg string) error
}

func NewTestServiceClientWithAuth

func NewTestServiceClientWithAuth(client TestServiceClient, authHeader bearertoken.Token, cookieToken bearertoken.Token) TestServiceClientWithAuth

Jump to

Keyboard shortcuts

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